enhance: optimized ElementGroup

This commit is contained in:
NaBian committed 2022-01-19 22:56:50 +08:00
1 parent 483370f218
commit fda076b5e6
14 files changed
+330 -215

No files matched your search

@@ -6,8 +6,20 @@
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">
<hc:TransitioningContentControl>
<StackPanel Margin="32" VerticalAlignment="Center">
<hc:ElementGroup Orientation="Horizontal">
<hc:UniformSpacingPanel Margin="32" VerticalAlignment="Center" Orientation="Vertical" Spacing="16">
<hc:ElementGroup Orientation="Horizontal" Layout="Stack">
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
</hc:ElementGroup>
<hc:ElementGroup Orientation="Horizontal" Width="500">
<ToggleButton HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.ToggleButton}}"/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<ToggleButton HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.ToggleButton}}"/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
</hc:ElementGroup>
<hc:ElementGroup Orientation="Horizontal" Layout="Stack">
<Border Style="{StaticResource BorderRegion}" Padding="6,0">
<Path Data="{StaticResource ClockGeometry}" Width="16" Height="16" Stretch="Uniform" Fill="{DynamicResource BorderBrush}"/>
</Border>
@@ -15,11 +27,20 @@
<Button Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<ToggleButton Content="{ex:Lang Key={x:Static langs:LangKeys.ToggleButton}}"/>
</hc:ElementGroup>
<hc:ElementGroup Margin="0,16,0,0">
<TextBox/>
<Button HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}"/>
<ToggleButton HorizontalAlignment="Stretch" Width="auto" Content="{ex:Lang Key={x:Static langs:LangKeys.ToggleButton}}"/>
<hc:ElementGroup>
<hc:ElementGroup.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</hc:ElementGroup.ItemsPanel>
<TextBox HorizontalAlignment="Stretch" DockPanel.Dock="Left"/>
<Button Grid.Column="1" Width="100" Content="{ex:Lang Key={x:Static langs:LangKeys.Button}}" DockPanel.Dock="Right" HorizontalAlignment="Right" Style="{StaticResource ButtonPrimary}"/>
</hc:ElementGroup>
</StackPanel>
</hc:UniformSpacingPanel>
</hc:TransitioningContentControl>
</UserControl>