Skip to content

Commit

Permalink
chore: minor modify demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
NaBian committed Jan 22, 2023
1 parent 6c35309 commit 322e366
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Basic/Geometries.xaml" />
<ResourceDictionary Source="../Basic/Brushes.xaml" />
<ResourceDictionary Source="../Basic/Fonts.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style x:Key="DemoInfoSortButtonStyle" BasedOn="{StaticResource ToggleButtonCustom}" TargetType="ToggleButton" x:Shared="False">
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="Height" Value="28" />
<Setter Property="Width" Value="28" />
<Setter Property="Content">
<Setter.Value>
<Rectangle Width="16" Height="16" Fill="{StaticResource Brush.SortAscending}" />
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
</Trigger>
</Style.Triggers>
</Style>

<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
<Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Height" Value="77" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,6 @@
Margin="16,16,0,16"
CornerRadius="10"
Effect="{StaticResource EffectShadow4}">
<Border.Resources>
<Style x:Key="DemoInfoSortButtonStyle" BasedOn="{StaticResource ToggleButtonCustom}" TargetType="ToggleButton" x:Shared="False">
<Setter Property="Content">
<Setter.Value>
<Border CornerRadius="4" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" Height="30" Width="30" >
<Rectangle Width="16" Height="16" Fill="{StaticResource Brush.SortAscending}" />
</Border>
</Setter.Value>
</Setter>
<Setter Property="hc:StatusSwitchElement.CheckedElement">
<Setter.Value>
<Border CornerRadius="4" Height="30" Width="30" BorderThickness="1" BorderBrush="{DynamicResource PrimaryBrush}"/>
</Setter.Value>
</Setter>
</Style>
</Border.Resources>
<DockPanel>
<Button Command="{Binding OpenPracticalDemoCmd}" DockPanel.Dock="Top" HorizontalAlignment="Stretch" Margin="10,10,10,4" Content="{ex:Lang Key={x:Static langs:LangKeys.PracticalDemos}}" BorderThickness="0" Background="{DynamicResource SecondaryRegionBrush}"/>
<TabControl BorderThickness="0 1 0 0" SelectionChanged="TabControl_OnSelectionChanged" ItemContainerStyle="{StaticResource TabItemTransparent}" ItemsSource="{Binding DemoInfoCollection}" Style="{StaticResource TabControlInLine}" Background="Transparent" SelectedIndex="0">
Expand All @@ -37,16 +21,24 @@
<DataTemplate>
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<hc:SearchBar hc:InfoElement.ShowClearButton="True" IsRealTime="True" SearchStarted="SearchBar_OnSearchStarted" Style="{StaticResource SearchBarPlus}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterKey}}" Margin="0,4,4,4" Tag="{Binding ElementName=ListBoxDemo}"/>
<ToggleButton Tag="{Binding ElementName=ListBoxDemo}" Name="ButtonStyleAscending" Click="ButtonAscending_OnClick" Grid.Row="0" Grid.Column="1" Style="{StaticResource DemoInfoSortButtonStyle}"/>
<ListBox Name="ListBoxDemo" Padding="0" ScrollViewer.CanContentScroll="False" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" VirtualizingStackPanel.IsVirtualizing="True" SelectedIndex="{Binding SelectedIndex}" ItemsSource="{Binding DemoItemList}" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
<hc:ElementGroup Margin="0 0 0 4">
<hc:ElementGroup.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</hc:ElementGroup.ItemsPanel>
<hc:SearchBar hc:InfoElement.ShowClearButton="True" IsRealTime="True" SearchStarted="SearchBar_OnSearchStarted" Style="{StaticResource SearchBarPlus}" hc:InfoElement.Placeholder="{ex:Lang Key={x:Static langs:LangKeys.PlsEnterKey}}" Tag="{Binding ElementName=ListBoxDemo}" />
<ToggleButton Grid.Column="1" Tag="{Binding ElementName=ListBoxDemo}" Name="ButtonStyleAscending" Click="ButtonAscending_OnClick" Style="{StaticResource DemoInfoSortButtonStyle}" />
</hc:ElementGroup>
<ListBox Name="ListBoxDemo" Padding="0" ScrollViewer.CanContentScroll="False" Grid.Row="1" VirtualizingStackPanel.IsVirtualizing="True" SelectedIndex="{Binding SelectedIndex}" ItemsSource="{Binding DemoItemList}" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
Expand Down

0 comments on commit 322e366

Please sign in to comment.