enhance: optimized ElementGroup
This commit is contained in:
1 parent
483370f218
commit
fda076b5e6
14 files changed
+330
-215
No files matched your search
@@ -0,0 +1,39 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style x:Key="ElementGroupBaseStyle" TargetType="hc:ElementGroup">
|
||||
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||
<Setter Property="Layout" Value="Uniform"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformHorizontalItemsPanelTemplate}"/>
|
||||
<Setter Property="hc:VisualElement.HighlightBorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="hc:VisualElement.HighlightBackground" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="hc:VisualElement.HighlightForeground" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Layout" Value="Uniform"/>
|
||||
<Condition Property="Orientation" Value="Vertical"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformVerticalItemsPanelTemplate}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Layout" Value="Stack"/>
|
||||
<Condition Property="Orientation" Value="Horizontal"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StackHorizontalItemsPanelTemplate}"/>
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="Layout" Value="Stack"/>
|
||||
<Condition Property="Orientation" Value="Vertical"/>
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StackVerticalItemsPanelTemplate}"/>
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,32 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<ItemsPanelTemplate x:Key="UniformHorizontalItemsPanelTemplate">
|
||||
<UniformGrid FocusVisualStyle="{x:Null}" Rows="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="UniformVerticalItemsPanelTemplate">
|
||||
<UniformGrid FocusVisualStyle="{x:Null}" Columns="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="StackHorizontalItemsPanelTemplate">
|
||||
<StackPanel FocusVisualStyle="{x:Null}" Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="StackVerticalItemsPanelTemplate">
|
||||
<StackPanel FocusVisualStyle="{x:Null}"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="WrapHorizontalItemsPanelTemplate">
|
||||
<WrapPanel FocusVisualStyle="{x:Null}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="WrapVerticalItemsPanelTemplate">
|
||||
<WrapPanel FocusVisualStyle="{x:Null}" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="DockItemsPanelTemplate">
|
||||
<DockPanel FocusVisualStyle="{x:Null}" LastChildFill="True"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -66,14 +66,6 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="StepBarHorizontalItemsPanelTemplate">
|
||||
<UniformGrid Rows="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ItemsPanelTemplate x:Key="StepBarVerticalItemsPanelTemplate">
|
||||
<UniformGrid Columns="1"/>
|
||||
</ItemsPanelTemplate>
|
||||
|
||||
<ControlTemplate x:Key="StepBarHorizontalTopControlTemplate" TargetType="hc:StepBar">
|
||||
<hc:SimplePanel>
|
||||
<ProgressBar HorizontalAlignment="Center" Name="PART_ProgressBarBack" VerticalAlignment="Top" Margin="0,10,0,0" Style="{StaticResource ProgressBarFlat}" Background="{DynamicResource ThirdlyTextBrush}"/>
|
||||
@@ -105,23 +97,23 @@
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource StepBarItemHorizontalTop}"/>
|
||||
<Setter Property="Template" Value="{StaticResource StepBarHorizontalTopControlTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StepBarHorizontalItemsPanelTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformHorizontalItemsPanelTemplate}"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Dock" Value="Left">
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource StepBarItemVerticalLeft}"/>
|
||||
<Setter Property="Template" Value="{StaticResource StepBarVerticalLeftControlTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StepBarVerticalItemsPanelTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformVerticalItemsPanelTemplate}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Dock" Value="Bottom">
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource StepBarItemHorizontalBottom}"/>
|
||||
<Setter Property="Template" Value="{StaticResource StepBarHorizontalBottomControlTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StepBarHorizontalItemsPanelTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformHorizontalItemsPanelTemplate}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Dock" Value="Right">
|
||||
<Setter Property="FlowDirection" Value="RightToLeft"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource StepBarItemVerticalLeft}"/>
|
||||
<Setter Property="Template" Value="{StaticResource StepBarVerticalLeftControlTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource StepBarVerticalItemsPanelTemplate}"/>
|
||||
<Setter Property="ItemsPanel" Value="{StaticResource UniformVerticalItemsPanelTemplate}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
Reference in new issue
Block a user