Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara authored Nov 17, 2023
1 parent c73c9b8 commit 4acb20d
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 25 deletions.
49 changes: 33 additions & 16 deletions ModernWpf.MahApps/Styles/Controls.FlipView.xaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:Controls="http://metro.mahapps.com/winfx/xaml/controls">

<sys:Double x:Key="FlipViewButtonFontSize">8</sys:Double>
<sys:Double x:Key="FlipViewButtonFontSizePointerOver">9</sys:Double>
<sys:Double x:Key="FlipViewButtonFontSizePressed">7</sys:Double>

<Style x:Key="DefaultFlipViewStyle" TargetType="Controls:FlipView">
<Setter Property="Background" Value="{DynamicResource FlipViewBackground}" />
<Setter Property="BorderThickness" Value="0" />
Expand Down Expand Up @@ -71,7 +76,7 @@
<ui:FontIconFallback
x:Name="Arrow"
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="12"
FontSize="{DynamicResource FlipViewButtonFontSize}"
Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
Data="{StaticResource CaretRight}"
HorizontalAlignment="Center"
Expand All @@ -83,11 +88,13 @@
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -101,7 +108,7 @@
<ui:FontIconFallback
x:Name="Arrow"
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="12"
FontSize="{DynamicResource FlipViewButtonFontSize}"
Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
Data="{StaticResource CaretLeft}"
HorizontalAlignment="Center"
Expand All @@ -113,11 +120,13 @@
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -131,7 +140,7 @@
<ui:FontIconFallback
x:Name="Arrow"
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="12"
FontSize="{DynamicResource FlipViewButtonFontSize}"
Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
Data="{StaticResource CaretDown}"
HorizontalAlignment="Center"
Expand All @@ -143,11 +152,13 @@
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -161,7 +172,7 @@
<ui:FontIconFallback
x:Name="Arrow"
FontFamily="{DynamicResource SymbolThemeFontFamily}"
FontSize="12"
FontSize="{DynamicResource FlipViewButtonFontSize}"
Foreground="{DynamicResource FlipViewNextPreviousArrowForeground}"
Data="{StaticResource CaretUp}"
HorizontalAlignment="Center"
Expand All @@ -173,11 +184,13 @@
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPointerOver}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPointerOver}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPointerOver}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePointerOver}" />
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Root" Property="Background" Value="{DynamicResource FlipViewNextPreviousButtonBackgroundPressed}" />
<Setter TargetName="Root" Property="BorderBrush" Value="{DynamicResource FlipViewNextPreviousButtonBorderBrushPressed}" />
<Setter TargetName="Arrow" Property="Foreground" Value="{DynamicResource FlipViewNextPreviousArrowForegroundPressed}" />
<Setter TargetName="Arrow" Property="FontSize" Value="{StaticResource FlipViewButtonFontSizePressed}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -193,9 +206,10 @@
<Button
x:Name="PART_BackButton"
Template="{StaticResource HorizontalPreviousTemplate}"
Width="20"
Height="36"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}"
Width="16"
Height="38"
Margin="1"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
IsTabStop="False"
FocusVisualStyle="{x:Null}"
HorizontalAlignment="Left"
Expand All @@ -204,9 +218,10 @@
<Button
x:Name="PART_ForwardButton"
Template="{StaticResource HorizontalNextTemplate}"
Width="20"
Height="36"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}"
Width="16"
Height="38"
Margin="1"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
IsTabStop="False"
FocusVisualStyle="{x:Null}"
HorizontalAlignment="Right"
Expand All @@ -215,9 +230,10 @@
<Button
x:Name="PART_UpButton"
Template="{StaticResource VerticalPreviousTemplate}"
Width="36"
Height="20"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource BottomCornerRadiusFilterConverter}}"
Width="38"
Height="16"
Margin="1"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
IsTabStop="False"
FocusVisualStyle="{x:Null}"
HorizontalAlignment="Center"
Expand All @@ -226,9 +242,10 @@
<Button
x:Name="PART_DownButton"
Template="{StaticResource VerticalNextTemplate}"
Width="36"
Height="20"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}"
Width="38"
Height="16"
Margin="1"
ui:ControlHelper.CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
IsTabStop="False"
FocusVisualStyle="{x:Null}"
HorizontalAlignment="Center"
Expand Down
6 changes: 3 additions & 3 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -913,9 +913,9 @@
<!-- Resources for FlipView -->
<Thickness x:Key="FlipViewButtonBorderThemeThickness">0</Thickness>
<m:StaticResource x:Key="FlipViewBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="ControlAltFillColorQuarternaryBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="ControlStrokeColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="ControlAAStrokeColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForeground" ResourceKey="ControlAAFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
Expand Down
6 changes: 3 additions & 3 deletions ModernWpf/ThemeResources/HighContrast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -800,9 +800,9 @@
<!-- Resources for FlipView -->
<Thickness x:Key="FlipViewButtonBorderThemeThickness">0</Thickness>
<m:StaticResource x:Key="FlipViewBackground" ResourceKey="SystemControlPageBackgroundListLowBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="SystemControlBackgroundBaseMediumLowBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="SystemControlHighlightBaseMediumBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="SystemControlHighlightBaseMediumHighBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForeground" ResourceKey="SystemControlForegroundAltMediumHighBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPointerOver" ResourceKey="SystemControlHighlightAltAltMediumHighBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPressed" ResourceKey="SystemControlHighlightAltAltMediumHighBrush" />
Expand Down
6 changes: 3 additions & 3 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -916,9 +916,9 @@
<!-- Resources for FlipView -->
<Thickness x:Key="FlipViewButtonBorderThemeThickness">0</Thickness>
<m:StaticResource x:Key="FlipViewBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="ControlAltFillColorQuarternaryBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="ControlStrokeColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="ControlAAStrokeColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackground" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPointerOver" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousButtonBackgroundPressed" ResourceKey="AcrylicInAppFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForeground" ResourceKey="ControlAAFillColorDefaultBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPointerOver" ResourceKey="TextFillColorSecondaryBrush" />
<m:StaticResource x:Key="FlipViewNextPreviousArrowForegroundPressed" ResourceKey="TextFillColorSecondaryBrush" />
Expand Down

0 comments on commit 4acb20d

Please sign in to comment.