Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara authored Dec 13, 2023
1 parent c4dda82 commit e5d2903
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 17 deletions.
318 changes: 301 additions & 17 deletions ModernWpf.Controls/CommandBar/CommandBar.xaml

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions ModernWpf/Styles/CornerRadius.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:primitives="clr-namespace:ModernWpf.Controls.Primitives">
<primitives:CornerRadiusFilterConverter x:Key="TopCornerRadiusFilterConverter" Filter="Top"/>
<primitives:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="Right"/>
<primitives:CornerRadiusFilterConverter x:Key="BottomCornerRadiusFilterConverter" Filter="Bottom"/>
<primitives:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="Left"/>
<primitives:CornerRadiusFilterConverter x:Key="TopLeftCornerRadiusDoubleValueConverter" Filter="TopLeftValue"/>
<primitives:CornerRadiusFilterConverter x:Key="BottomRightCornerRadiusDoubleValueConverter" Filter="BottomRightValue"/>
</ResourceDictionary>
2 changes: 2 additions & 0 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1491,6 +1491,8 @@
<m:StaticResource x:Key="SplitButtonBorderBrushCheckedDivider" ResourceKey="ControlStrokeColorOnAccentTertiaryBrush" />
<Thickness x:Key="SplitButtonBorderThemeThickness">1</Thickness>

<m:StaticResource x:Key="SplitButtonInAppBarUnfocusedPointerOver" ResourceKey="SubtleFillColorTertiaryBrush" />

<!-- Resources for SplitView -->
<sys:Double x:Key="SplitViewOpenPaneThemeLength">320</sys:Double>
<sys:Double x:Key="SplitViewCompactPaneThemeLength">48</sys:Double>
Expand Down
2 changes: 2 additions & 0 deletions ModernWpf/ThemeResources/HighContrast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,8 @@
<m:StaticResource x:Key="SplitButtonBorderBrushCheckedDivider" ResourceKey="SystemControlHighlightAltTransparentBrush" />
<Thickness x:Key="SplitButtonBorderThemeThickness">1</Thickness>

<m:StaticResource x:Key="SplitButtonInAppBarUnfocusedPointerOver" ResourceKey="SubtleFillColorTertiaryBrush" />

<!-- Resources for SplitView -->
<sys:Double x:Key="SplitViewOpenPaneThemeLength">320</sys:Double>
<sys:Double x:Key="SplitViewCompactPaneThemeLength">48</sys:Double>
Expand Down
2 changes: 2 additions & 0 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1493,6 +1493,8 @@
<m:StaticResource x:Key="SplitButtonBorderBrushCheckedDivider" ResourceKey="ControlStrokeColorOnAccentTertiaryBrush" />
<Thickness x:Key="SplitButtonBorderThemeThickness">1</Thickness>

<m:StaticResource x:Key="SplitButtonInAppBarUnfocusedPointerOver" ResourceKey="SubtleFillColorTertiaryBrush" />

<!-- Resources for SplitView -->
<sys:Double x:Key="SplitViewOpenPaneThemeLength">320</sys:Double>
<sys:Double x:Key="SplitViewCompactPaneThemeLength">48</sys:Double>
Expand Down
39 changes: 39 additions & 0 deletions test/ModernWpfTestApp/CommandBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="http://schemas.modernwpf.com/2019"
mc:Ignorable="d"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

Expand All @@ -20,6 +21,20 @@
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<AppBarElementContainer IsTabStop="False">
<controls:SplitButton Content="Split">
<controls:SplitButton.Flyout>
<MenuFlyout Placement="Bottom">
<MenuFlyoutItem Text="Do Something"/>
<MenuFlyoutItem Text="Something Else"/>
<MenuFlyoutItem Text="Yet More Things"/>
</MenuFlyout>
</controls:SplitButton.Flyout>
</controls:SplitButton>
</AppBarElementContainer>
<AppBarElementContainer IsTabStop="False">
<controls:ToggleSplitButton Content="Toggle"/>
</AppBarElementContainer>
</CommandBar>

<CommandBar>
Expand All @@ -42,6 +57,30 @@
<AppBarSeparator/>
<AppBarButton Icon="Save" Label="Save"/>
<AppBarToggleButton Icon="Add" Label="Toggle"/>
<AppBarElementContainer>
<controls:SplitButton>
<Grid Margin="0,1,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<controls:SymbolIcon Symbol="Keyboard" Margin="0,0,8,0"/>
<TextBlock Grid.Column="1" Text="Split"/>
</Grid>
</controls:SplitButton>
</AppBarElementContainer>
<AppBarElementContainer>
<controls:ToggleSplitButton>
<Grid Margin="0,1,0,0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<controls:SymbolIcon Symbol="Shuffle" Margin="0,0,8,0"/>
<TextBlock Grid.Column="1" Text="Toggle"/>
</Grid>
</controls:ToggleSplitButton>
</AppBarElementContainer>
</CommandBar>

<CommandBar DefaultLabelPosition="Collapsed">
Expand Down

0 comments on commit e5d2903

Please sign in to comment.