Browse Source
Verbatim copy of the v1 Fluent theme renamed to Fluent2Theme / Avalonia.Themes.Fluent2, as the starting point for the Fluent 2 (WinUI 3 visual language) re-skin. No visual changes in this commit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>pull/21771/head
90 changed files with 12780 additions and 0 deletions
@ -0,0 +1,70 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<!-- https://docs.microsoft.com/en-us/previous-versions/windows/apps/dn518235(v=win.10)?redirectedfrom=MSDN --> |
|||
<ResourceDictionary.ThemeDictionaries> |
|||
<ResourceDictionary x:Key="Default"> |
|||
<Color x:Key="SystemAltHighColor">#FFFFFFFF</Color> |
|||
<Color x:Key="SystemAltLowColor">#33FFFFFF</Color> |
|||
<Color x:Key="SystemAltMediumColor">#99FFFFFF</Color> |
|||
<Color x:Key="SystemAltMediumHighColor">#CCFFFFFF</Color> |
|||
<Color x:Key="SystemAltMediumLowColor">#66FFFFFF</Color> |
|||
<Color x:Key="SystemBaseHighColor">#FF000000</Color> |
|||
<Color x:Key="SystemBaseLowColor">#33000000</Color> |
|||
<Color x:Key="SystemBaseMediumColor">#99000000</Color> |
|||
<Color x:Key="SystemBaseMediumHighColor">#CC000000</Color> |
|||
<Color x:Key="SystemBaseMediumLowColor">#66000000</Color> |
|||
<Color x:Key="SystemChromeAltLowColor">#FF171717</Color> |
|||
<Color x:Key="SystemChromeBlackHighColor">#FF000000</Color> |
|||
<Color x:Key="SystemChromeBlackLowColor">#33000000</Color> |
|||
<Color x:Key="SystemChromeBlackMediumLowColor">#66000000</Color> |
|||
<Color x:Key="SystemChromeBlackMediumColor">#CC000000</Color> |
|||
<Color x:Key="SystemChromeDisabledHighColor">#FFCCCCCC</Color> |
|||
<Color x:Key="SystemChromeDisabledLowColor">#FF7A7A7A</Color> |
|||
<Color x:Key="SystemChromeHighColor">#FFCCCCCC</Color> |
|||
<Color x:Key="SystemChromeLowColor">#FFF2F2F2</Color> |
|||
<Color x:Key="SystemChromeMediumColor">#FFE6E6E6</Color> |
|||
<Color x:Key="SystemChromeMediumLowColor">#FFF2F2F2</Color> |
|||
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color> |
|||
<Color x:Key="SystemChromeGrayColor">#FF767676</Color> |
|||
<Color x:Key="SystemListLowColor">#19000000</Color> |
|||
<Color x:Key="SystemListMediumColor">#33000000</Color> |
|||
<Color x:Key="SystemErrorTextColor">#C50500</Color> |
|||
<Color x:Key="SystemRegionColor">#FFFFFFFF</Color> |
|||
<Color x:Key="SystemRevealListLowColor">#17000000</Color> |
|||
<Color x:Key="SystemRevealListMediumColor">#2E000000</Color> |
|||
</ResourceDictionary> |
|||
<ResourceDictionary x:Key="Dark"> |
|||
<Color x:Key="SystemAltHighColor">#FF000000</Color> |
|||
<Color x:Key="SystemAltLowColor">#33000000</Color> |
|||
<Color x:Key="SystemAltMediumColor">#99000000</Color> |
|||
<Color x:Key="SystemAltMediumHighColor">#CC000000</Color> |
|||
<Color x:Key="SystemAltMediumLowColor">#66000000</Color> |
|||
<Color x:Key="SystemBaseHighColor">#FFFFFFFF</Color> |
|||
<Color x:Key="SystemBaseLowColor">#33FFFFFF</Color> |
|||
<Color x:Key="SystemBaseMediumColor">#99FFFFFF</Color> |
|||
<Color x:Key="SystemBaseMediumHighColor">#CCFFFFFF</Color> |
|||
<Color x:Key="SystemBaseMediumLowColor">#66FFFFFF</Color> |
|||
<Color x:Key="SystemChromeAltLowColor">#FFF2F2F2</Color> |
|||
<Color x:Key="SystemChromeBlackHighColor">#FF000000</Color> |
|||
<Color x:Key="SystemChromeBlackLowColor">#33000000</Color> |
|||
<Color x:Key="SystemChromeBlackMediumLowColor">#66000000</Color> |
|||
<Color x:Key="SystemChromeBlackMediumColor">#CC000000</Color> |
|||
<Color x:Key="SystemChromeDisabledHighColor">#FF333333</Color> |
|||
<Color x:Key="SystemChromeDisabledLowColor">#FF858585</Color> |
|||
<Color x:Key="SystemChromeHighColor">#FF767676</Color> |
|||
<Color x:Key="SystemChromeLowColor">#FF171717</Color> |
|||
<Color x:Key="SystemChromeMediumColor">#FF1F1F1F</Color> |
|||
<Color x:Key="SystemChromeMediumLowColor">#FF2B2B2B</Color> |
|||
<Color x:Key="SystemChromeWhiteColor">#FFFFFFFF</Color> |
|||
<Color x:Key="SystemChromeGrayColor">#FF767676</Color> |
|||
<Color x:Key="SystemListLowColor">#19FFFFFF</Color> |
|||
<Color x:Key="SystemListMediumColor">#33FFFFFF</Color> |
|||
<Color x:Key="SystemErrorTextColor">#FFF000</Color> |
|||
<Color x:Key="SystemRegionColor">#FF000000</Color> |
|||
<Color x:Key="SystemRevealListLowColor">#18FFFFFF</Color> |
|||
<Color x:Key="SystemRevealListMediumColor">#30FFFFFF</Color> |
|||
</ResourceDictionary> |
|||
</ResourceDictionary.ThemeDictionaries> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,380 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
<FontFamily x:Key="ContentControlThemeFontFamily">fonts:Inter#Inter, $Default</FontFamily> |
|||
<sys:Double x:Key="ControlContentThemeFontSize">14</sys:Double> |
|||
|
|||
<SolidColorBrush x:Key="SystemControlTransparentBrush" Color="Transparent" /> |
|||
<x:Boolean x:Key="UseSystemFocusVisuals">True</x:Boolean> |
|||
<Thickness x:Key="TextControlBorderThemeThickness">1</Thickness> |
|||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">2</Thickness> |
|||
<Thickness x:Key="TextControlThemePadding">10,6,6,5</Thickness> |
|||
<sys:Double x:Key="IconElementThemeHeight">20</sys:Double> |
|||
<sys:Double x:Key="IconElementThemeWidth">20</sys:Double> |
|||
<sys:Double x:Key="RefreshVisualizerIndicatorSize">24</sys:Double> |
|||
<Thickness x:Key="ButtonPadding">8,5,8,6</Thickness> |
|||
|
|||
<!-- Override system shape defaults --> |
|||
<CornerRadius x:Key="ControlCornerRadius">3</CornerRadius> |
|||
<CornerRadius x:Key="OverlayCornerRadius">5</CornerRadius> |
|||
|
|||
<!-- ScrollBar animation --> |
|||
<TransformOperations x:Key="VerticalSmallScrollThumbScaleTransform">scaleX(0.125) translateX(-2px)</TransformOperations> |
|||
<TransformOperations x:Key="HorizontalSmallScrollThumbScaleTransform">scaleY(0.125) translateY(-2px)</TransformOperations> |
|||
|
|||
<converters:CornerRadiusFilterConverter x:Key="TopCornerRadiusFilterConverter" Filter="TopLeft, TopRight" /> |
|||
<converters:CornerRadiusFilterConverter x:Key="RightCornerRadiusFilterConverter" Filter="TopRight, BottomRight" /> |
|||
<converters:CornerRadiusFilterConverter x:Key="BottomCornerRadiusFilterConverter" Filter="BottomLeft, BottomRight" /> |
|||
<converters:CornerRadiusFilterConverter x:Key="LeftCornerRadiusFilterConverter" Filter="TopLeft, BottomLeft" /> |
|||
|
|||
<x:Double x:Key="AutoCompleteListMaxHeight">374</x:Double> |
|||
<Thickness x:Key="AutoCompleteListMargin">0,2,0,2</Thickness> |
|||
<Thickness x:Key="AutoCompleteListBorderThemeThickness">1</Thickness> |
|||
<Thickness x:Key="AutoCompleteListPadding">-1,0,-1,0</Thickness> |
|||
<x:Double x:Key="TextControlThemeMinHeight">32</x:Double> |
|||
<x:Double x:Key="TextControlThemeMinWidth">64</x:Double> |
|||
<x:Double x:Key="FlyoutThemeMaxWidth">456</x:Double> |
|||
<Thickness x:Key="DateTimeFlyoutButtonBorderThickness">0</Thickness> |
|||
<Thickness x:Key="DateTimeFlyoutBorderThickness">1</Thickness> |
|||
<Thickness x:Key="DateTimeFlyoutBorderPadding">0</Thickness> |
|||
|
|||
<Thickness x:Key="FlyoutContentThemePadding">12,11,12,12</Thickness> |
|||
<x:Double x:Key="FlyoutThemeMinWidth">96</x:Double> |
|||
<x:Double x:Key="FlyoutThemeMinHeight">40</x:Double> |
|||
<x:Double x:Key="FlyoutThemeMaxHeight">758</x:Double> |
|||
|
|||
<!-- Moved from FlyoutPresenter.xaml --> |
|||
<Thickness x:Key="FlyoutBorderThemePadding">0</Thickness> |
|||
|
|||
<!-- Moved from MenuItem.xaml --> |
|||
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness> |
|||
|
|||
<!-- Moved from Menu.xaml --> |
|||
<Thickness x:Key="MenuBarItemPadding">12,0,12,0</Thickness> |
|||
|
|||
<ResourceDictionary.ThemeDictionaries> |
|||
<ResourceDictionary x:Key="Default"> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumBrush" Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" |
|||
Color="{StaticResource SystemAltMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackHighBrush" |
|||
Color="{StaticResource SystemChromeBlackHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackMediumBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackLowBrush" |
|||
Color="{StaticResource SystemChromeBlackLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumBrush" |
|||
Color="{StaticResource SystemChromeMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeDisabledHighBrush" |
|||
Color="{StaticResource SystemChromeDisabledHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeDisabledLowBrush" |
|||
Color="{StaticResource SystemChromeDisabledLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlFocusVisualPrimaryBrush" Color="{DynamicResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlFocusVisualSecondaryBrush" Color="{DynamicResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlRevealFocusVisualBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackHighBrush" |
|||
Color="{StaticResource SystemChromeBlackHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeMediumBrush" |
|||
Color="{StaticResource SystemChromeMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeDisabledLowBrush" |
|||
Color="{StaticResource SystemChromeDisabledLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackMediumBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeGrayBrush" Color="{StaticResource SystemChromeGrayColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentHighBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.7" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentLowBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.4" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentMediumBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltChromeWhiteBrush" |
|||
Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeAltLowBrush" Color="{StaticResource SystemChromeAltLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentHighBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.7" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentLowBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.4" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentMediumBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkTextBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundAltMediumBrush" Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" |
|||
Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundBaseMediumBrush" |
|||
Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeLowBrush" Color="{StaticResource SystemChromeLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.14" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListLowRevealBackgroundBrush" |
|||
Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListMediumRevealBackgroundBrush" |
|||
Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccentRevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccent3RevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccent2RevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.8" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeWhiteRevealBorderBrush" |
|||
Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltTransparentRevealBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundTransparentRevealBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlTransientBackgroundBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" |
|||
ResourceKey="SystemControlPageTextBaseMediumBrush" /> |
|||
|
|||
<SolidColorBrush x:Key="SystemControlTransparentRevealBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlTransparentRevealBorderBrush" Color="Transparent" /> |
|||
|
|||
<SolidColorBrush x:Key="SystemRegionBrush" Color="{StaticResource SystemRegionColor}" /> |
|||
</ResourceDictionary> |
|||
<ResourceDictionary x:Key="Dark"> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumBrush" Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundAltMediumLowBrush" |
|||
Color="{StaticResource SystemAltMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackHighBrush" |
|||
Color="{StaticResource SystemChromeBlackHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackMediumBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackLowBrush" |
|||
Color="{StaticResource SystemChromeBlackLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumBrush" |
|||
Color="{StaticResource SystemChromeMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeDisabledHighBrush" |
|||
Color="{StaticResource SystemChromeDisabledHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeDisabledLowBrush" |
|||
Color="{StaticResource SystemChromeDisabledLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlDisabledTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlFocusVisualPrimaryBrush" Color="{DynamicResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlFocusVisualSecondaryBrush" Color="{DynamicResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlRevealFocusVisualBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackHighBrush" |
|||
Color="{StaticResource SystemChromeBlackHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeMediumBrush" |
|||
Color="{StaticResource SystemChromeMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeDisabledLowBrush" |
|||
Color="{StaticResource SystemChromeDisabledLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeGrayBrush" Color="{StaticResource SystemChromeGrayColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackMediumBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlForegroundChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAccentBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltAltMediumHighBrush" |
|||
Color="{StaticResource SystemAltMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentHighBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.9" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentLowBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltListAccentMediumBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.8" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltChromeWhiteBrush" |
|||
Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightBaseMediumLowBrush" |
|||
Color="{StaticResource SystemBaseMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeAltLowBrush" Color="{StaticResource SystemChromeAltLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeHighBrush" Color="{StaticResource SystemChromeHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentHighBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.9" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentLowBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListAccentMediumBrush" Color="{DynamicResource SystemAccentColor}" |
|||
Opacity="0.8" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListMediumBrush" Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightChromeWhiteBrush" Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkTextBrush" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHyperlinkBaseMediumHighBrush" |
|||
Color="{StaticResource SystemBaseMediumHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundAltMediumBrush" Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundAltHighBrush" Color="{StaticResource SystemAltHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" |
|||
Color="{StaticResource SystemAltMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundBaseLowBrush" Color="{StaticResource SystemBaseLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundBaseMediumBrush" |
|||
Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundListLowBrush" Color="{StaticResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeLowBrush" Color="{StaticResource SystemChromeLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundChromeMediumLowBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageBackgroundTransparentBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextBaseHighBrush" Color="{StaticResource SystemBaseHighColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextBaseMediumBrush" Color="{StaticResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlPageTextChromeBlackMediumLowBrush" |
|||
Color="{StaticResource SystemChromeBlackMediumLowColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="{StaticResource SystemErrorTextColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlTransientBorderBrush" Color="#000000" Opacity="0.36" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListLowRevealBackgroundBrush" |
|||
Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightListMediumRevealBackgroundBrush" |
|||
Color="{StaticResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccentRevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccent3RevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.6" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAccent2RevealBackgroundBrush" |
|||
Color="{DynamicResource SystemAccentColor}" Opacity="0.8" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundChromeWhiteRevealBorderBrush" |
|||
Color="{StaticResource SystemChromeWhiteColor}" /> |
|||
<SolidColorBrush x:Key="SystemControlHighlightAltTransparentRevealBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlBackgroundTransparentRevealBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlTransientBackgroundBrush" |
|||
Color="{StaticResource SystemChromeMediumLowColor}" /> |
|||
<StaticResource x:Key="SystemControlDescriptionTextForegroundBrush" |
|||
ResourceKey="SystemControlPageTextBaseMediumBrush" /> |
|||
<SolidColorBrush x:Key="SystemControlTransparentRevealBackgroundBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="SystemControlTransparentRevealBorderBrush" Color="Transparent" /> |
|||
|
|||
<SolidColorBrush x:Key="SystemRegionBrush" Color="{StaticResource SystemRegionColor}" /> |
|||
</ResourceDictionary> |
|||
</ResourceDictionary.ThemeDictionaries> |
|||
</ResourceDictionary> |
|||
File diff suppressed because it is too large
@ -0,0 +1,160 @@ |
|||
using System; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Media; |
|||
using Avalonia.Platform; |
|||
using Avalonia.Styling; |
|||
using Avalonia.VisualTree; |
|||
|
|||
namespace Avalonia.Themes.Fluent2.Accents; |
|||
|
|||
internal sealed class SystemAccentColors : ResourceProvider |
|||
{ |
|||
public const string AccentKey = "SystemAccentColor"; |
|||
public const string AccentDark1Key = "SystemAccentColorDark1"; |
|||
public const string AccentDark2Key = "SystemAccentColorDark2"; |
|||
public const string AccentDark3Key = "SystemAccentColorDark3"; |
|||
public const string AccentLight1Key = "SystemAccentColorLight1"; |
|||
public const string AccentLight2Key = "SystemAccentColorLight2"; |
|||
public const string AccentLight3Key = "SystemAccentColorLight3"; |
|||
|
|||
private static readonly Color s_defaultSystemAccentColor = Color.FromRgb(0, 120, 215); |
|||
private bool _invalidateColors = true; |
|||
private Color _systemAccentColor; |
|||
private Color _systemAccentColorDark1, _systemAccentColorDark2, _systemAccentColorDark3; |
|||
private Color _systemAccentColorLight1, _systemAccentColorLight2, _systemAccentColorLight3; |
|||
|
|||
public override bool HasResources => true; |
|||
public override bool TryGetResource(object key, ThemeVariant? theme, out object? value) |
|||
{ |
|||
if (key is string strKey) |
|||
{ |
|||
if (strKey.Equals(AccentKey, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColor; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentDark1Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorDark1; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentDark2Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorDark2; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentDark3Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorDark3; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentLight1Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorLight1; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentLight2Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorLight2; |
|||
return true; |
|||
} |
|||
|
|||
if (strKey.Equals(AccentLight3Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
EnsureColors(); |
|||
value = _systemAccentColorLight3; |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
value = null; |
|||
return false; |
|||
} |
|||
|
|||
protected override void OnAddOwner(IResourceHost owner) |
|||
{ |
|||
if (GetFromOwner(owner) is { } platformSettings) |
|||
{ |
|||
platformSettings.ColorValuesChanged += PlatformSettingsOnColorValuesChanged; |
|||
} |
|||
|
|||
_invalidateColors = true; |
|||
} |
|||
|
|||
protected override void OnRemoveOwner(IResourceHost owner) |
|||
{ |
|||
if (GetFromOwner(owner) is { } platformSettings) |
|||
{ |
|||
platformSettings.ColorValuesChanged -= PlatformSettingsOnColorValuesChanged; |
|||
} |
|||
|
|||
_invalidateColors = true; |
|||
} |
|||
|
|||
private void EnsureColors() |
|||
{ |
|||
if (_invalidateColors) |
|||
{ |
|||
_invalidateColors = false; |
|||
|
|||
var platformSettings = GetFromOwner(Owner); |
|||
|
|||
_systemAccentColor = platformSettings?.GetColorValues().AccentColor1 ?? s_defaultSystemAccentColor; |
|||
(_systemAccentColorDark1,_systemAccentColorDark2, _systemAccentColorDark3, |
|||
_systemAccentColorLight1, _systemAccentColorLight2, _systemAccentColorLight3) = CalculateAccentShades(_systemAccentColor); |
|||
} |
|||
} |
|||
|
|||
private static IPlatformSettings? GetFromOwner(IResourceHost? owner) |
|||
{ |
|||
return owner switch |
|||
{ |
|||
Application app => app.PlatformSettings, |
|||
Visual visual => visual.GetPlatformSettings(), |
|||
_ => null |
|||
}; |
|||
} |
|||
|
|||
public static (Color d1, Color d2, Color d3, Color l1, Color l2, Color l3) CalculateAccentShades(Color accentColor) |
|||
{ |
|||
// dark1step = (hslAccent.L - SystemAccentColorDark1.L) * 255
|
|||
const double dark1step = 28.5 / 255d; |
|||
const double dark2step = 49 / 255d; |
|||
const double dark3step = 74.5 / 255d; |
|||
// light1step = (SystemAccentColorLight1.L - hslAccent.L) * 255
|
|||
const double light1step = 39 / 255d; |
|||
const double light2step = 70 / 255d; |
|||
const double light3step = 103 / 255d; |
|||
|
|||
var hslAccent = accentColor.ToHsl(); |
|||
|
|||
return ( |
|||
// Darker shades
|
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L - dark1step).ToRgb(), |
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L - dark2step).ToRgb(), |
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L - dark3step).ToRgb(), |
|||
|
|||
// Lighter shades
|
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L + light1step).ToRgb(), |
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L + light2step).ToRgb(), |
|||
new HslColor(hslAccent.A, hslAccent.H, hslAccent.S, hslAccent.L + light3step).ToRgb() |
|||
); |
|||
} |
|||
|
|||
private void PlatformSettingsOnColorValuesChanged(object? sender, PlatformColorValues e) |
|||
{ |
|||
_invalidateColors = true; |
|||
Owner?.NotifyHostedResourcesChanged(ResourcesChangedEventArgs.Create()); |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
<PropertyGroup> |
|||
<TargetFrameworks>$(AvsCurrentTargetFramework);$(AvsLegacyTargetFrameworks)</TargetFrameworks> |
|||
</PropertyGroup> |
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Avalonia.Base\Avalonia.Base.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Controls\Avalonia.Controls.csproj" /> |
|||
<ProjectReference Include="..\Avalonia.Dialogs\Avalonia.Dialogs.csproj" /> |
|||
<ProjectReference Include="..\Markup\Avalonia.Markup.Xaml\Avalonia.Markup.Xaml.csproj" /> |
|||
<AvaloniaResource Include="**/*.xaml" /> |
|||
</ItemGroup> |
|||
<Import Project="..\..\build\NullableEnable.props" /> |
|||
<Import Project="..\..\build\BuildTargets.targets" /> |
|||
<Import Project="..\..\build\TrimmingEnable.props" /> |
|||
<Import Project="..\..\build\DevAnalyzers.props" /> |
|||
</Project> |
|||
@ -0,0 +1,158 @@ |
|||
using Avalonia.Media; |
|||
|
|||
namespace Avalonia.Themes.Fluent2; |
|||
|
|||
public partial class ColorPaletteResources |
|||
{ |
|||
private bool _hasAccentColor; |
|||
private Color _accentColor; |
|||
private Color _accentColorDark1, _accentColorDark2, _accentColorDark3; |
|||
private Color _accentColorLight1, _accentColorLight2, _accentColorLight3; |
|||
|
|||
public static readonly DirectProperty<ColorPaletteResources, Color> AccentProperty |
|||
= AvaloniaProperty.RegisterDirect<ColorPaletteResources, Color>(nameof(Accent), r => r.Accent, (r, v) => r.Accent = v); |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the Accent color value.
|
|||
/// </summary>
|
|||
public Color Accent |
|||
{ |
|||
get => _accentColor; |
|||
set => SetAndRaise(AccentProperty, ref _accentColor, value); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the AltHigh color value.
|
|||
/// </summary>
|
|||
public Color AltHigh { get => GetColor("SystemAltHighColor"); set => SetColor("SystemAltHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the AltLow color value.
|
|||
/// </summary>
|
|||
public Color AltLow { get => GetColor("SystemAltLowColor"); set => SetColor("SystemAltLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the AltMedium color value.
|
|||
/// </summary>
|
|||
public Color AltMedium { get => GetColor("SystemAltMediumColor"); set => SetColor("SystemAltMediumColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the AltMediumHigh color value.
|
|||
/// </summary>
|
|||
public Color AltMediumHigh { get => GetColor("SystemAltMediumHighColor"); set => SetColor("SystemAltMediumHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the AltMediumLow color value.
|
|||
/// </summary>
|
|||
public Color AltMediumLow { get => GetColor("SystemAltMediumLowColor"); set => SetColor("SystemAltMediumLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the BaseHigh color value.
|
|||
/// </summary>
|
|||
public Color BaseHigh { get => GetColor("SystemBaseHighColor"); set => SetColor("SystemBaseHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the BaseLow color value.
|
|||
/// </summary>
|
|||
public Color BaseLow { get => GetColor("SystemBaseLowColor"); set => SetColor("SystemBaseLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the BaseMedium color value.
|
|||
/// </summary>
|
|||
public Color BaseMedium { get => GetColor("SystemBaseMediumColor"); set => SetColor("SystemBaseMediumColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the BaseMediumHigh color value.
|
|||
/// </summary>
|
|||
public Color BaseMediumHigh { get => GetColor("SystemBaseMediumHighColor"); set => SetColor("SystemBaseMediumHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the BaseMediumLow color value.
|
|||
/// </summary>
|
|||
public Color BaseMediumLow { get => GetColor("SystemBaseMediumLowColor"); set => SetColor("SystemBaseMediumLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeAltLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeAltLow { get => GetColor("SystemChromeAltLowColor"); set => SetColor("SystemChromeAltLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeBlackHigh color value.
|
|||
/// </summary>
|
|||
public Color ChromeBlackHigh { get => GetColor("SystemChromeBlackHighColor"); set => SetColor("SystemChromeBlackHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeBlackLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeBlackLow { get => GetColor("SystemChromeBlackLowColor"); set => SetColor("SystemChromeBlackLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeBlackMedium color value.
|
|||
/// </summary>
|
|||
public Color ChromeBlackMedium { get => GetColor("SystemChromeBlackMediumColor"); set => SetColor("SystemChromeBlackMediumColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeBlackMediumLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeBlackMediumLow { get => GetColor("SystemChromeBlackMediumLowColor"); set => SetColor("SystemChromeBlackMediumLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeDisabledHigh color value.
|
|||
/// </summary>
|
|||
public Color ChromeDisabledHigh { get => GetColor("SystemChromeDisabledHighColor"); set => SetColor("SystemChromeDisabledHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeDisabledLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeDisabledLow { get => GetColor("SystemChromeDisabledLowColor"); set => SetColor("SystemChromeDisabledLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeGray color value.
|
|||
/// </summary>
|
|||
public Color ChromeGray { get => GetColor("SystemChromeGrayColor"); set => SetColor("SystemChromeGrayColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeHigh color value.
|
|||
/// </summary>
|
|||
public Color ChromeHigh { get => GetColor("SystemChromeHighColor"); set => SetColor("SystemChromeHighColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeLow { get => GetColor("SystemChromeLowColor"); set => SetColor("SystemChromeLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeMedium color value.
|
|||
/// </summary>
|
|||
public Color ChromeMedium { get => GetColor("SystemChromeMediumColor"); set => SetColor("SystemChromeMediumColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeMediumLow color value.
|
|||
/// </summary>
|
|||
public Color ChromeMediumLow { get => GetColor("SystemChromeMediumLowColor"); set => SetColor("SystemChromeMediumLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ChromeWhite color value.
|
|||
/// </summary>
|
|||
public Color ChromeWhite { get => GetColor("SystemChromeWhiteColor"); set => SetColor("SystemChromeWhiteColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ErrorText color value.
|
|||
/// </summary>
|
|||
public Color ErrorText { get => GetColor("SystemErrorTextColor"); set => SetColor("SystemErrorTextColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ListLow color value.
|
|||
/// </summary>
|
|||
public Color ListLow { get => GetColor("SystemListLowColor"); set => SetColor("SystemListLowColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the ListMedium color value.
|
|||
/// </summary>
|
|||
public Color ListMedium { get => GetColor("SystemListMediumColor"); set => SetColor("SystemListMediumColor", value); } |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the RegionColor color value.
|
|||
/// </summary>
|
|||
public Color RegionColor { get => GetColor("SystemRegionColor"); set => SetColor("SystemRegionColor", value); } |
|||
} |
|||
@ -0,0 +1,119 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Media; |
|||
using Avalonia.Styling; |
|||
using Avalonia.Themes.Fluent2.Accents; |
|||
|
|||
namespace Avalonia.Themes.Fluent2; |
|||
|
|||
/// <summary>
|
|||
/// Represents a specialized resource dictionary that contains color resources used by Fluent2Theme elements.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This class can only be used in <see cref="Fluent2Theme.Palettes"/>.
|
|||
/// </remarks>
|
|||
public partial class ColorPaletteResources : ResourceProvider |
|||
{ |
|||
private readonly Dictionary<string, Color> _colors = new(StringComparer.InvariantCulture); |
|||
|
|||
public override bool HasResources => _hasAccentColor || _colors.Count > 0; |
|||
|
|||
public override bool TryGetResource(object key, ThemeVariant? theme, out object? value) |
|||
{ |
|||
if (key is string strKey) |
|||
{ |
|||
if (strKey.Equals(SystemAccentColors.AccentKey, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColor; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentDark1Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorDark1; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentDark2Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorDark2; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentDark3Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorDark3; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentLight1Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorLight1; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentLight2Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorLight2; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (strKey.Equals(SystemAccentColors.AccentLight3Key, StringComparison.InvariantCulture)) |
|||
{ |
|||
value = _accentColorLight3; |
|||
return _hasAccentColor; |
|||
} |
|||
|
|||
if (_colors.TryGetValue(strKey, out var color)) |
|||
{ |
|||
value = color; |
|||
return true; |
|||
} |
|||
} |
|||
|
|||
value = null; |
|||
return false; |
|||
} |
|||
|
|||
private Color GetColor(string key) |
|||
{ |
|||
if (_colors.TryGetValue(key, out var color)) |
|||
{ |
|||
return color; |
|||
} |
|||
|
|||
return default; |
|||
} |
|||
|
|||
private void SetColor(string key, Color value) |
|||
{ |
|||
if (value == default) |
|||
{ |
|||
_colors.Remove(key); |
|||
} |
|||
else |
|||
{ |
|||
_colors[key] = value; |
|||
} |
|||
} |
|||
|
|||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) |
|||
{ |
|||
base.OnPropertyChanged(change); |
|||
|
|||
if (change.Property == AccentProperty) |
|||
{ |
|||
_hasAccentColor = _accentColor != default; |
|||
|
|||
if (_hasAccentColor) |
|||
{ |
|||
(_accentColorDark1, _accentColorDark2, _accentColorDark3, |
|||
_accentColorLight1, _accentColorLight2, _accentColorLight3) = |
|||
SystemAccentColors.CalculateAccentShades(_accentColor); |
|||
} |
|||
RaiseResourcesChanged(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,148 @@ |
|||
using System; |
|||
using System.Collections; |
|||
using System.Collections.Generic; |
|||
using System.Diagnostics.CodeAnalysis; |
|||
using Avalonia.Collections; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Themes.Fluent2; |
|||
|
|||
internal sealed class ColorPaletteResourcesCollection : ResourceProvider, IDictionary<ThemeVariant, ColorPaletteResources> |
|||
{ |
|||
private readonly AvaloniaDictionary<ThemeVariant, ColorPaletteResources> _inner; |
|||
|
|||
public ColorPaletteResourcesCollection() |
|||
{ |
|||
_inner = new AvaloniaDictionary<ThemeVariant, ColorPaletteResources>(2); |
|||
_inner.ForEachItem( |
|||
(key, x) => |
|||
{ |
|||
if (Owner is not null) |
|||
{ |
|||
((IResourceProvider)x).AddOwner(Owner); |
|||
} |
|||
|
|||
if (key != ThemeVariant.Dark && key != ThemeVariant.Light) |
|||
{ |
|||
throw new InvalidOperationException( |
|||
$"{nameof(Fluent2Theme)}.{nameof(Fluent2Theme.Palettes)} only supports Light and Dark variants."); |
|||
} |
|||
}, |
|||
(_, x) => |
|||
{ |
|||
if (Owner is not null) |
|||
{ |
|||
((IResourceProvider)x).RemoveOwner(Owner); |
|||
} |
|||
}, |
|||
() => throw new NotSupportedException("Dictionary reset not supported")); |
|||
} |
|||
|
|||
public override bool HasResources => _inner.Count > 0; |
|||
public override bool TryGetResource(object key, ThemeVariant? theme, out object? value) |
|||
{ |
|||
if (theme == null || theme == ThemeVariant.Default) |
|||
{ |
|||
theme = ThemeVariant.Light; |
|||
} |
|||
|
|||
if (_inner.TryGetValue(theme, out var themePaletteResources) |
|||
&& themePaletteResources.TryGetResource(key, theme, out value)) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
value = null; |
|||
return false; |
|||
} |
|||
|
|||
protected override void OnAddOwner(IResourceHost owner) |
|||
{ |
|||
base.OnAddOwner(owner); |
|||
foreach (var palette in _inner.Values) |
|||
{ |
|||
((IResourceProvider)palette).AddOwner(owner); |
|||
} |
|||
} |
|||
|
|||
protected override void OnRemoveOwner(IResourceHost owner) |
|||
{ |
|||
base.OnRemoveOwner(owner); |
|||
foreach (var palette in _inner.Values) |
|||
{ |
|||
((IResourceProvider)palette).RemoveOwner(owner); |
|||
} |
|||
} |
|||
|
|||
IEnumerator<KeyValuePair<ThemeVariant, ColorPaletteResources>> IEnumerable<KeyValuePair<ThemeVariant, ColorPaletteResources>>.GetEnumerator() |
|||
{ |
|||
return _inner.GetEnumerator(); |
|||
} |
|||
|
|||
IEnumerator IEnumerable.GetEnumerator() |
|||
{ |
|||
return ((IEnumerable)_inner).GetEnumerator(); |
|||
} |
|||
|
|||
void ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.Add(KeyValuePair<ThemeVariant, ColorPaletteResources> item) |
|||
{ |
|||
((ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>)_inner).Add(item); |
|||
} |
|||
|
|||
void ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.Clear() |
|||
{ |
|||
_inner.Clear(); |
|||
} |
|||
|
|||
bool ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.Contains(KeyValuePair<ThemeVariant, ColorPaletteResources> item) |
|||
{ |
|||
return ((ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>)_inner).Contains(item); |
|||
} |
|||
|
|||
void ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.CopyTo(KeyValuePair<ThemeVariant, ColorPaletteResources>[] array, int arrayIndex) |
|||
{ |
|||
_inner.CopyTo(array, arrayIndex); |
|||
} |
|||
|
|||
bool ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.Remove(KeyValuePair<ThemeVariant, ColorPaletteResources> item) |
|||
{ |
|||
return ((ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>)_inner).Remove(item); |
|||
} |
|||
|
|||
int ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.Count => _inner.Count; |
|||
|
|||
bool ICollection<KeyValuePair<ThemeVariant, ColorPaletteResources>>.IsReadOnly => _inner.IsReadOnly; |
|||
|
|||
void IDictionary<ThemeVariant, ColorPaletteResources>.Add(ThemeVariant key, ColorPaletteResources value) |
|||
{ |
|||
_inner.Add(key, value); |
|||
} |
|||
|
|||
bool IDictionary<ThemeVariant, ColorPaletteResources>.ContainsKey(ThemeVariant key) |
|||
{ |
|||
return _inner.ContainsKey(key); |
|||
} |
|||
|
|||
bool IDictionary<ThemeVariant, ColorPaletteResources>.Remove(ThemeVariant key) |
|||
{ |
|||
return _inner.Remove(key); |
|||
} |
|||
|
|||
bool IDictionary<ThemeVariant, ColorPaletteResources>.TryGetValue(ThemeVariant key, |
|||
[MaybeNullWhen(false)] |
|||
out ColorPaletteResources value) |
|||
{ |
|||
return _inner.TryGetValue(key, out value); |
|||
} |
|||
|
|||
ColorPaletteResources IDictionary<ThemeVariant, ColorPaletteResources>.this[ThemeVariant key] |
|||
{ |
|||
get => _inner[key]; |
|||
set => _inner[key] = value; |
|||
} |
|||
|
|||
ICollection<ThemeVariant> IDictionary<ThemeVariant, ColorPaletteResources>.Keys => _inner.Keys; |
|||
|
|||
ICollection<ColorPaletteResources> IDictionary<ThemeVariant, ColorPaletteResources>.Values => _inner.Values; |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Thickness x:Key="SystemControlFocusVisualMargin">0</Thickness> |
|||
<Thickness x:Key="SystemControlFocusVisualPrimaryThickness">2</Thickness> |
|||
<Thickness x:Key="SystemControlFocusVisualSecondaryThickness">1</Thickness> |
|||
|
|||
<ControlTheme x:Key="{x:Type AdornerLayer}" TargetType="AdornerLayer"> |
|||
<Setter Property="DefaultFocusAdorner"> |
|||
<FocusAdornerTemplate> |
|||
<Border BorderThickness="{DynamicResource SystemControlFocusVisualPrimaryThickness}" |
|||
BorderBrush="{DynamicResource SystemControlFocusVisualPrimaryBrush}" |
|||
Margin="{DynamicResource SystemControlFocusVisualMargin}"> |
|||
<Border BorderThickness="{DynamicResource SystemControlFocusVisualSecondaryThickness}" |
|||
BorderBrush="{DynamicResource SystemControlFocusVisualSecondaryBrush}" /> |
|||
</Border> |
|||
</FocusAdornerTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,80 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:generic="using:System.Collections.Generic" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<AutoCompleteBox Width="200"> |
|||
<AutoCompleteBox.ItemsSource> |
|||
<generic:List x:TypeArguments="x:String"> |
|||
Alabama |
|||
Alaska |
|||
Arizona |
|||
Arkansas |
|||
California |
|||
Colorado |
|||
Connecticut |
|||
Delaware |
|||
</generic:List> |
|||
</AutoCompleteBox.ItemsSource> |
|||
</AutoCompleteBox> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteListMaxHeight}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="PART_LayoutRoot"> |
|||
<TextBox Name="PART_TextBox" |
|||
PlaceholderText="{TemplateBinding PlaceholderText}" |
|||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}" |
|||
Width="{TemplateBinding Width}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
CaretIndex="{TemplateBinding CaretIndex, Mode=TwoWay}" |
|||
ClearSelectionOnLostFocus="{TemplateBinding ClearSelectionOnLostFocus}" |
|||
Padding="{TemplateBinding Padding}" |
|||
Margin="0" |
|||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
|||
MaxLength="{TemplateBinding MaxLength}" |
|||
InnerLeftContent="{TemplateBinding InnerLeftContent}" |
|||
InnerRightContent="{TemplateBinding InnerRightContent}" |
|||
/> |
|||
<Popup Name="PART_Popup" |
|||
WindowManagerAddShadowHint="False" |
|||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|||
MaxHeight="{TemplateBinding MaxDropDownHeight}" |
|||
IsLightDismissEnabled="True" |
|||
PlacementTarget="{TemplateBinding}"> |
|||
<Border Name="PART_SuggestionsContainer" |
|||
Padding="{DynamicResource AutoCompleteListMargin}" |
|||
BorderThickness="{DynamicResource AutoCompleteListBorderThemeThickness}" |
|||
BorderBrush="{DynamicResource AutoCompleteBoxSuggestionsListBorderBrush}" |
|||
Background="{DynamicResource AutoCompleteBoxSuggestionsListBackground}" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ListBox Name="PART_SelectingItemsControl" |
|||
BorderThickness="0" |
|||
Background="Transparent" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{DynamicResource AutoCompleteListPadding}" |
|||
ScrollViewer.IsScrollChainingEnabled="False" /> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,96 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<Button Content="Click Me!" /> |
|||
<Button Classes="accent" Content="Click Me!" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type Button}" TargetType="Button"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.075" /> |
|||
</Transitions> |
|||
</Setter> |
|||
|
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^.accent"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource AccentButtonBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource AccentButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource AccentButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource AccentButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,156 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<ButtonSpinner Content="Right spinner" /> |
|||
<ButtonSpinner ButtonSpinnerLocation="Left" |
|||
Content="Left spinner" /> |
|||
<ButtonSpinner BorderThickness="2" |
|||
BorderBrush="Blue" |
|||
Content="Right Border" /> |
|||
<ButtonSpinner ButtonSpinnerLocation="Left" |
|||
BorderThickness="2" |
|||
BorderBrush="Blue" |
|||
Content="Left Border" /> |
|||
<ButtonSpinner Content="Right disabled" |
|||
AllowSpin="False"/> |
|||
<ButtonSpinner ButtonSpinnerLocation="Left" |
|||
Content="Left disabled" |
|||
AllowSpin="False"/> |
|||
<ButtonSpinner ShowButtonSpinner="False" |
|||
Content="Hide spinner" /> |
|||
<ButtonSpinner Content="Error"> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</ButtonSpinner> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<converters:MarginMultiplierConverter x:Key="ButtonSpinnerLeftThickness" Indent="1" Left="True" /> |
|||
<converters:MarginMultiplierConverter x:Key="ButtonSpinnerRightThickness" Indent="1" Right="True" /> |
|||
<StreamGeometry x:Key="ButtonSpinnerIncreaseButtonIcon">M0,9 L10,0 20,9 19,10 10,2 1,10 z</StreamGeometry> |
|||
<StreamGeometry x:Key="ButtonSpinnerDecreaseButtonIcon">M0,1 L10,10 20,1 19,0 10,8 1,0 z</StreamGeometry> |
|||
|
|||
<ControlTheme x:Key="FluentButtonSpinnerRepeatButton" TargetType="RepeatButton"> |
|||
<Setter Property="MinWidth" Value="34" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type ButtonSpinner}" TargetType="ButtonSpinner"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Padding" Value="10, 0" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Focusable" Value="True"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
MinHeight="{TemplateBinding MinHeight}"> |
|||
<DockPanel> |
|||
<StackPanel Name="PART_SpinnerPanel" |
|||
TabIndex="2" |
|||
DockPanel.Dock="Right" |
|||
Orientation="Horizontal" |
|||
IsVisible="{TemplateBinding ShowButtonSpinner}"> |
|||
<RepeatButton Name="PART_IncreaseButton" |
|||
IsTabStop="{TemplateBinding IsTabStop}" |
|||
Theme="{StaticResource FluentButtonSpinnerRepeatButton}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerLeftThickness}}" |
|||
VerticalAlignment="Stretch" |
|||
VerticalContentAlignment="Center" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
MinWidth="34"> |
|||
<PathIcon Width="16" |
|||
Height="8" |
|||
Data="{StaticResource ButtonSpinnerIncreaseButtonIcon}" /> |
|||
</RepeatButton> |
|||
|
|||
<RepeatButton Name="PART_DecreaseButton" |
|||
IsTabStop="{TemplateBinding IsTabStop}" |
|||
Theme="{StaticResource FluentButtonSpinnerRepeatButton}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerLeftThickness}}" |
|||
VerticalAlignment="Stretch" |
|||
VerticalContentAlignment="Center" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
MinWidth="34"> |
|||
<PathIcon Width="16" |
|||
Height="8" |
|||
Data="{StaticResource ButtonSpinnerDecreaseButtonIcon}" /> |
|||
</RepeatButton> |
|||
</StackPanel> |
|||
|
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Grid.Column="1" |
|||
TabIndex="1" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Padding="{TemplateBinding Padding}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:left"> |
|||
<Style Selector="^ /template/ StackPanel#PART_SpinnerPanel"> |
|||
<Setter Property="DockPanel.Dock" Value="Left"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ RepeatButton"> |
|||
<Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness, Converter={StaticResource ButtonSpinnerRightThickness}}"/> |
|||
</Style> |
|||
</Style> |
|||
<Style Selector="^:error"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemErrorTextColor}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,42 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Calendar /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type Calendar}" TargetType="Calendar"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource CalendarFontSize}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel |
|||
Name="PART_Root" |
|||
HorizontalAlignment="Center" |
|||
ClipToBounds="True"> |
|||
<CalendarItem |
|||
Name="PART_CalendarItem" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
HeaderBackground="{TemplateBinding HeaderBackground}" /> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,116 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<CalendarButton/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type CalendarButton}" TargetType="CalendarButton"> |
|||
<Setter Property="ClickMode" Value="Release" /> |
|||
<Setter Property="MinWidth" Value="40" /> |
|||
<Setter Property="MinHeight" Value="40" /> |
|||
<Setter Property="Margin" Value="1" /> |
|||
<Setter Property="Padding" Value="0,0,0,0" /> |
|||
<!--These are actually set on the CalendarView in WinUI--> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewCalendarItemForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewCalendarItemRevealBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewCalendarItemRevealBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="2" /> |
|||
<Setter Property="ClipToBounds" Value="False" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<!-- To mimic WinUI SystemFocusVisual, Focus visual is drawn outside the bounds of the item --> |
|||
<Border Name="Root" Background="{TemplateBinding Background}" |
|||
BorderThickness="0" ClipToBounds="True"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</Border> |
|||
|
|||
<!-- Drawn Border should render on top of background to preserve the 1px margin between items --> |
|||
<Border Name="Border" |
|||
BorderThickness="2" |
|||
BorderBrush="{TemplateBinding BorderBrush}" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewHoverBorderBrush}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark2}" /> |
|||
</Style> |
|||
|
|||
<!-- Adjusted :selected to look like :today from DayItem --> |
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedBorderBrush}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}" /> |
|||
<Setter Property="FontWeight" Value="{DynamicResource CalendarViewTodayFontWeight}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark1}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark2}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- WinUI calls this OutOfFocus --> |
|||
<Style Selector="^:inactive"> |
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<!-- These are probably set in code, but consistent --> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewOutOfScopeBackground}"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:blackout /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,180 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Margin="20, 20, 20, 200"> |
|||
<CalendarDatePicker Width="200" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="CalendarDatePickerCurrentDayFontSize">12</x:Double> |
|||
<x:Double x:Key="CalendarDatePickerMinHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="FluentCalendarDatePickerButton" TargetType="Button"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerCalendarGlyphForeground}" /> |
|||
<Setter Property="Margin" Value="2,0,4,0" /> |
|||
<Setter Property="Width" Value="20" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Height="24" |
|||
Width="20" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Margin="0" |
|||
ColumnDefinitions="*,*,*,*" |
|||
RowDefinitions="23*,19*,19*,19*" |
|||
ClipToBounds="False"> |
|||
<Border Name="Background" |
|||
Margin="0,-1,0,0" |
|||
Grid.ColumnSpan="4" |
|||
Grid.Row="1" |
|||
Grid.RowSpan="3" |
|||
BorderThickness="0.5,0,0.5,0.5" |
|||
BorderBrush="{TemplateBinding Foreground}" |
|||
CornerRadius="0,0,2,2" /> |
|||
<Border Grid.ColumnSpan="4" |
|||
Grid.RowSpan="1" |
|||
BorderBrush="{TemplateBinding Foreground}" |
|||
BorderThickness="0.5" |
|||
CornerRadius="2,2,0,0" /> |
|||
<TextBlock Margin="0,-1,0,0" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Center" |
|||
Grid.Column="0" |
|||
Grid.Row="1" |
|||
Grid.ColumnSpan="4" |
|||
Grid.RowSpan="3" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
FontSize="{DynamicResource CalendarDatePickerCurrentDayFontSize}" |
|||
Text="{Binding Source={x:Static sys:DateTime.Today}, Path=Day}" /> |
|||
<Ellipse HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Fill="{TemplateBinding Foreground}" |
|||
StrokeThickness="0" |
|||
Grid.ColumnSpan="4" |
|||
Width="3" |
|||
Height="3" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type CalendarDatePicker}" TargetType="CalendarDatePicker"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerMinHeight}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Padding" Value="4" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Panel x:Name="LayoutRoot" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<Border x:Name="Background" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Background="{TemplateBinding Background}" /> |
|||
<Grid ColumnDefinitions="*,Auto"> |
|||
<TextBox Name="PART_TextBox" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="Transparent" |
|||
BorderBrush="Transparent" |
|||
BorderThickness="0" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Margin="{TemplateBinding BorderThickness}" |
|||
Padding="{TemplateBinding Padding}" |
|||
PlaceholderText="{TemplateBinding PlaceholderText}" |
|||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}" |
|||
UseFloatingPlaceholder="{TemplateBinding UseFloatingPlaceholder}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Grid.Column="0"> |
|||
<TextBox.Styles> |
|||
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_BorderElement"> |
|||
<!-- By default the TextBox has its own focused state, override this to disable it here --> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
<Setter Property="BorderBrush" Value="Transparent"/> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
</Style> |
|||
<Style Selector="TextBox#PART_TextBox:disabled"> |
|||
<Style Selector="^ /template/ Border#PART_BorderElement"> |
|||
<!-- By default the TextBox has its own disabled state, override this to make the border background show through --> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderBrush" Value="Transparent" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PART_Placeholder, ^ TextBlock#PART_FloatingPlaceholder"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerTextForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</TextBox.Styles> |
|||
</TextBox> |
|||
<Button Name="PART_Button" |
|||
Theme="{StaticResource FluentCalendarDatePickerButton}" |
|||
Grid.Column="1" |
|||
Focusable="False" /> |
|||
<Popup Name="PART_Popup" |
|||
PlacementTarget="{TemplateBinding}" |
|||
IsLightDismissEnabled="True"> |
|||
<Calendar Name="PART_Calendar" |
|||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}" |
|||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" |
|||
SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedDate, Mode=TwoWay}" |
|||
DisplayDate="{TemplateBinding DisplayDate}" |
|||
DisplayDateStart="{TemplateBinding DisplayDateStart}" |
|||
DisplayDateEnd="{TemplateBinding DisplayDateEnd}" /> |
|||
</Popup> |
|||
</Grid> |
|||
</Panel> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Pointer-over State --> |
|||
<Style Selector="^:pointerover /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Button#PART_Button"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerCalendarGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="^:focus-within:not(CalendarDatePicker:focus) /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" /> |
|||
</Style> |
|||
|
|||
<!-- Error State --> |
|||
<Style Selector="^:error /template/ Border#Background"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,111 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<CalendarButton/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type CalendarDayButton}" TargetType="CalendarDayButton"> |
|||
<Setter Property="ClickMode" Value="Release" /> |
|||
<Setter Property="MinWidth" Value="40" /> |
|||
<Setter Property="MinHeight" Value="40" /> |
|||
<Setter Property="Margin" Value="1" /> |
|||
<Setter Property="Padding" Value="0,0,0,0" /> |
|||
<!--These are actually set on the CalendarView in WinUI--> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewCalendarItemForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewCalendarItemRevealBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewCalendarItemRevealBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="2" /> |
|||
<Setter Property="ClipToBounds" Value="False" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<!-- To mimic WinUI SystemFocusVisual, Focus visual is drawn outside the bounds of the item --> |
|||
<Border Name="Root" Background="{TemplateBinding Background}" |
|||
BorderThickness="0" ClipToBounds="True"> |
|||
|
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
|
|||
</Border> |
|||
|
|||
<!-- Drawn Border should render on top of background to preserve the 1px margin between items--> |
|||
<Border Name="Border" |
|||
BorderThickness="2" |
|||
BorderBrush="{TemplateBinding BorderBrush}" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewHoverBorderBrush}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewPressedBorderBrush}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedBorderBrush}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedHoverBorderBrush}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedPressedBorderBrush}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:today"> |
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
<!-- These are probably set in code, but consistent --> |
|||
<Style Selector="^:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark1}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemAccentColorDark2}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}" /> |
|||
<Setter Property="FontWeight" Value="SemiBold" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- WinUI calls this OutOfFocus --> |
|||
<Style Selector="^:inactive"> |
|||
<Style Selector="^ /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewOutOfScopeBackground}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:blackout /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,163 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Calendar DisplayDate="2000-01-01"> |
|||
<Calendar.BlackoutDates> |
|||
<CalendarDateRange> |
|||
<x:Arguments> |
|||
<sys:DateTime>2000-01-01</sys:DateTime> |
|||
<sys:DateTime>2000-01-05</sys:DateTime> |
|||
</x:Arguments> |
|||
</CalendarDateRange> |
|||
</Calendar.BlackoutDates> |
|||
</Calendar> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="FluentCalendarButton" TargetType="Button"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<!-- HCA was changed here to ensure nav arrows display correctly --> |
|||
<ContentPresenter Name="PART_ContentPresenter" Background="{TemplateBinding Background}" |
|||
BorderBrush="{DynamicResource CalendarViewNavigationButtonBorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewNavigationButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewNavigationButtonForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type CalendarItem}" TargetType="CalendarItem"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="DayTitleTemplate"> |
|||
<Template x:DataType="x:String"> |
|||
<TextBlock Text="{Binding}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
FontSize="{DynamicResource CalendarDayButtonFontSize}" /> |
|||
</Template> |
|||
</Setter> |
|||
|
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderThickness="{TemplateBinding BorderThickness}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<!-- To keep calendar from resizing when switching DisplayMode |
|||
In WinUI Min-Width from TemplateSettings |
|||
basically...MinWidth of DayItem = 40, 40 * 7 = 280 + margins/padding = ~294 |
|||
Viewport height is set from # of rows displayed (2-8) in Month mode, = ~290 for 6 weeks (+ day names) |
|||
--> |
|||
<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" RowDefinitions="40,*" MinWidth="294"> |
|||
<Grid ColumnDefinitions="5*,*,*"> |
|||
<Button Name="PART_HeaderButton" |
|||
Theme="{StaticResource FluentCalendarButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="12,0,0,0" |
|||
HorizontalContentAlignment="Left" /> |
|||
<Button Name="PART_PreviousButton" |
|||
Grid.Column="1" |
|||
Theme="{StaticResource FluentCalendarButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="1" |
|||
HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path Stroke="{DynamicResource CalendarViewForeground}" |
|||
StrokeThickness="1.5" |
|||
Data="M 0,9 L 9,0 L 18,9" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" /> |
|||
</Button> |
|||
<Button Name="PART_NextButton" |
|||
Grid.Column="2" |
|||
Theme="{StaticResource FluentCalendarButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="1" |
|||
HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path Stroke="{DynamicResource CalendarViewForeground}" |
|||
StrokeThickness="1.5" |
|||
Data="M 0,0 L 9,9 L 18,0" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" /> |
|||
</Button> |
|||
</Grid> |
|||
<!--Border below is used only for MonthView but it can't be moved inside of Grid because CalendarItem expects it to be empty and it will cause side-effects--> |
|||
<Border Name="BackgroundLayer" Background="{TemplateBinding BorderBrush}" Margin="0,38,0,0" IsVisible="{Binding #PART_MonthView.IsVisible}" Grid.Row="1" /> |
|||
<Grid Name="PART_MonthView" Grid.Row="1" IsVisible="False" MinHeight="290"> |
|||
<Grid.RowDefinitions> |
|||
<!--This should always be the week day names??--> |
|||
<RowDefinition Height="38" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="Auto" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
</Grid> |
|||
<Grid Name="PART_YearView" |
|||
Background="{TemplateBinding BorderBrush}" |
|||
MinHeight="290" |
|||
Grid.Row="1" |
|||
IsVisible="False"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="*" /> |
|||
<RowDefinition Height="*" /> |
|||
<RowDefinition Height="*" /> |
|||
</Grid.RowDefinitions> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="*" /> |
|||
</Grid.ColumnDefinitions> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^ /template/ Button:pointerover > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Button:pressed > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPressed}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,21 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type Carousel}" TargetType="Carousel"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ScrollViewer Name="PART_ScrollViewer" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BringIntoViewOnFocusChange="False" |
|||
HorizontalScrollBarVisibility="Hidden" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</ScrollViewer> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,30 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Width="400" Height="300"> |
|||
<CarouselPage> |
|||
<ContentPage Header="Page 1"> |
|||
<TextBlock Text="First page" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
<ContentPage Header="Page 2"> |
|||
<TextBlock Text="Second page" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
</CarouselPage> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type CarouselPage}" TargetType="CarouselPage"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlPageBackgroundAltHighBrush}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Carousel Name="PART_Carousel" |
|||
Background="{TemplateBinding Background}" |
|||
ItemTemplate="{TemplateBinding PageTemplate}" |
|||
PageTransition="{TemplateBinding PageTransition}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,304 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<CheckBox>Unchecked</CheckBox> |
|||
<CheckBox IsChecked="True">Checked</CheckBox> |
|||
<CheckBox IsThreeState="True" IsChecked="{x:Null}">Indeterminate</CheckBox> |
|||
<CheckBox Width="120">Checkbox should wrap its text</CheckBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<StreamGeometry x:Key="CheckMarkPathData">M5.5 10.586 1.707 6.793A1 1 0 0 0 .293 8.207l4.5 4.5a1 1 0 0 0 1.414 0l11-11A1 1 0 0 0 15.793.293L5.5 10.586Z</StreamGeometry> |
|||
<x:Double x:Key="CheckBoxMinHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type CheckBox}" TargetType="CheckBox"> |
|||
<Setter Property="Padding" Value="8,0,0,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource CheckBoxMinHeight}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUnchecked}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUnchecked}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUnchecked}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="RootGrid" ColumnDefinitions="20,*"> |
|||
<Border x:Name="PART_Border" |
|||
Grid.ColumnSpan="2" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
|
|||
<Grid VerticalAlignment="Top" Height="{DynamicResource CheckBoxMinHeight}"> |
|||
<Border x:Name="NormalRectangle" |
|||
BorderBrush="{DynamicResource CheckBoxCheckBackgroundStrokeUnchecked}" |
|||
Background="{DynamicResource CheckBoxCheckBackgroundFillUnchecked}" |
|||
BorderThickness="{DynamicResource CheckBoxBorderThemeThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
UseLayoutRounding="False" |
|||
Height="20" |
|||
Width="20" /> |
|||
|
|||
<Viewbox UseLayoutRounding="False"> |
|||
<Panel> |
|||
<Panel Height="16" Width="16" /> |
|||
<Path x:Name="CheckGlyph" |
|||
Opacity="0" |
|||
Fill="{DynamicResource CheckBoxCheckGlyphForegroundUnchecked}" |
|||
Stretch="Uniform" |
|||
VerticalAlignment="Center" |
|||
FlowDirection="LeftToRight" /> |
|||
</Panel> |
|||
</Viewbox> |
|||
</Grid> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
TextWrapping="Wrap" |
|||
Grid.Column="1" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- Unchecked PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Unchecked Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedPressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Unchecked Disabled state --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked"> |
|||
<!-- Checked Normal State --> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundChecked}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundChecked}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushChecked}" /> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundFillChecked}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillChecked}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundChecked}" /> |
|||
<Setter Property="Data" Value="{StaticResource CheckMarkPathData}" /> |
|||
<Setter Property="Width" Value="9" /> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<!-- Checked PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Checked Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedPressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Checked Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:indeterminate"> |
|||
<!-- Indeterminate Normal State --> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminate}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminate}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminate}" /> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminate}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminate}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminate}" /> |
|||
<Setter Property="Data" Value="M1536 1536v-1024h-1024v1024h1024z" /> |
|||
<Setter Property="Width" Value="7" /> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<!-- Indeterminate PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminatePointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminatePointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminatePointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Indeterminate Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminatePressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminatePressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminatePressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Indeterminate Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminateDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminateDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminateDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,260 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="10"> |
|||
<ComboBox PlaceholderText="Select an item"> |
|||
<ComboBoxItem>Item 1</ComboBoxItem> |
|||
<ComboBoxItem>Item 2</ComboBoxItem> |
|||
</ComboBox> |
|||
<ComboBox IsEnabled="False" |
|||
Width="200" |
|||
SelectedIndex="1" |
|||
HorizontalContentAlignment="Center"> |
|||
<ComboBoxItem>Item 1</ComboBoxItem> |
|||
<ComboBoxItem>Item 2</ComboBoxItem> |
|||
</ComboBox> |
|||
|
|||
<ComboBox PlaceholderText="Error"> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</ComboBox> |
|||
|
|||
<ComboBox SelectedIndex="1" IsEditable="True"> |
|||
<ComboBoxItem>Item A</ComboBoxItem> |
|||
<ComboBoxItem>Item b</ComboBoxItem> |
|||
<ComboBoxItem>Item c</ComboBoxItem> |
|||
</ComboBox> |
|||
|
|||
<ComboBox SelectedIndex="0"> |
|||
<ComboBox.SelectionBoxItemTemplate> |
|||
<DataTemplate> |
|||
<Border Padding="20" BorderBrush="Red" BorderThickness="1"> |
|||
<TextBlock Text="{ReflectionBinding}"/> |
|||
</Border> |
|||
</DataTemplate> |
|||
</ComboBox.SelectionBoxItemTemplate> |
|||
<ComboBoxItem>Item A</ComboBoxItem> |
|||
<ComboBoxItem>Item b</ComboBoxItem> |
|||
<ComboBoxItem>Item c</ComboBoxItem> |
|||
</ComboBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="ComboBoxTopHeaderMargin">0,0,0,4</Thickness> |
|||
<x:Int32 x:Key="ComboBoxPopupMaxNumberOfItems">15</x:Int32> |
|||
<x:Int32 x:Key="ComboBoxPopupMaxNumberOfItemsThatCanBeShownOnOneSide">7</x:Int32> |
|||
|
|||
<Thickness x:Key="ComboBoxPadding">12,5,0,7</Thickness> |
|||
<Thickness x:Key="ComboBoxEditableTextPadding">11,5,32,6</Thickness> |
|||
<x:Double x:Key="ComboBoxMinHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type ComboBox}" TargetType="ComboBox"> |
|||
<Setter Property="Padding" Value="{DynamicResource ComboBoxPadding}" /> |
|||
<Setter Property="FocusAdorner" Value="{x:Null}" /> |
|||
<Setter Property="MaxDropDownHeight" Value="504" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ComboBoxBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource ComboBoxMinHeight}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Grid ColumnDefinitions="*,32"> |
|||
<Border x:Name="Background" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
MinWidth="{DynamicResource ComboBoxThemeMinWidth}" /> |
|||
<Border x:Name="HighlightBackground" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
Background="{DynamicResource ComboBoxBackgroundUnfocused}" |
|||
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsVisible="False"/> |
|||
<TextBlock x:Name="PlaceholderTextBlock" |
|||
Grid.Column="0" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Opacity="{DynamicResource TextControlPlaceholderOpacity}" |
|||
Margin="{TemplateBinding Padding}" |
|||
Text="{TemplateBinding PlaceholderText}" |
|||
Foreground="{TemplateBinding PlaceholderForeground}"> |
|||
<TextBlock.IsVisible> |
|||
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|||
<Binding Path="SelectionBoxItem" RelativeSource="{RelativeSource TemplatedParent}" Converter="{x:Static ObjectConverters.IsNull}" /> |
|||
<Binding Path="!IsEditable" RelativeSource="{RelativeSource TemplatedParent}" /> |
|||
</MultiBinding> |
|||
</TextBlock.IsVisible> |
|||
</TextBlock> |
|||
<ContentControl x:Name="ContentPresenter" |
|||
Content="{TemplateBinding SelectionBoxItem}" |
|||
Grid.Column="0" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
IsVisible="{TemplateBinding IsEditable, Converter={x:Static BoolConverters.Not}}"> |
|||
</ContentControl> |
|||
|
|||
<TextBox Name="PART_EditableTextBox" |
|||
Grid.Column="0" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="Transparent" |
|||
Text="{TemplateBinding Text, Mode=TwoWay}" |
|||
PlaceholderText="{TemplateBinding PlaceholderText}" |
|||
BorderThickness="0" |
|||
IsVisible="{TemplateBinding IsEditable}"> |
|||
<TextBox.Resources> |
|||
<SolidColorBrush x:Key="TextControlBackgroundFocused">Transparent</SolidColorBrush> |
|||
<SolidColorBrush x:Key="TextControlBackgroundPointerOver">Transparent</SolidColorBrush> |
|||
<Thickness x:Key="TextControlBorderThemeThicknessFocused">0</Thickness> |
|||
</TextBox.Resources> |
|||
</TextBox> |
|||
|
|||
<Border x:Name="DropDownOverlay" |
|||
Grid.Column="1" |
|||
Background="Transparent" |
|||
Margin="0,1,1,1" |
|||
Width="30" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Right" /> |
|||
|
|||
<PathIcon x:Name="DropDownGlyph" |
|||
Grid.Column="1" |
|||
UseLayoutRounding="False" |
|||
IsHitTestVisible="False" |
|||
Height="12" |
|||
Width="12" |
|||
Margin="0,0,10,0" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" |
|||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}" |
|||
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z"/> |
|||
|
|||
<Popup Name="PART_Popup" |
|||
WindowManagerAddShadowHint="False" |
|||
IsOpen="{TemplateBinding IsDropDownOpen, Mode=TwoWay}" |
|||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|||
MaxHeight="{TemplateBinding MaxDropDownHeight}" |
|||
PlacementTarget="Background" |
|||
IsLightDismissEnabled="True" |
|||
InheritsTransform="True"> |
|||
<Border x:Name="PopupBorder" |
|||
Background="{DynamicResource ComboBoxDropDownBackground}" |
|||
BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}" |
|||
BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}" |
|||
Padding="{DynamicResource ComboBoxDropdownBorderPadding}" |
|||
HorizontalAlignment="Stretch" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|||
IsScrollChainingEnabled="False" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" |
|||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Margin="{DynamicResource ComboBoxDropdownContentMargin}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="^:pointerover /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Error State --> |
|||
<Style Selector="^:error /template/ Border#Background"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Focus Pressed State --> |
|||
<Style Selector="^:focus:pressed"> |
|||
<Style Selector="^ /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocusedPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="^:focus-visible"> |
|||
<Style Selector="^ /template/ Border#HighlightBackground"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBackgroundBorderBrushFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^[IsEditable=true]"> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="KeyboardNavigation.TabNavigation" Value="Local" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,87 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Border Background="{DynamicResource ComboBoxDropDownBackground}" BorderBrush="{DynamicResource ComboBoxDropDownBorderBrush}" BorderThickness="{DynamicResource ComboBoxDropdownBorderThickness}" Margin="0,-1,0,-1" Padding="{DynamicResource ComboBoxDropdownBorderPadding}" CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<StackPanel HorizontalAlignment="Stretch"> |
|||
<ComboBoxItem>Item 1</ComboBoxItem> |
|||
<ComboBoxItem>Item 2 long</ComboBoxItem> |
|||
<ComboBoxItem IsSelected="True">Item 3</ComboBoxItem> |
|||
<ComboBoxItem IsEnabled="False">Item 4</ComboBoxItem> |
|||
<ComboBoxItem IsSelected="True" IsEnabled="False">Item 5</ComboBoxItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackground}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ComboBoxItemThemePadding}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Padding="{TemplateBinding Padding}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled state --> |
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed state --> |
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelected}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelected}" /> |
|||
</Style> |
|||
<!-- Selected Disabled state --> |
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedDisabled}" /> |
|||
</Style> |
|||
<!-- Selected PointerOver state --> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPointerOver}" /> |
|||
</Style> |
|||
<!-- Selected Pressed state --> |
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,332 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Width="600"> |
|||
<StackPanel Spacing="12"> |
|||
<CommandBar> |
|||
<CommandBarButton Label="New"> |
|||
<CommandBarButton.Icon> |
|||
<PathIcon Data="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" /> |
|||
</CommandBarButton.Icon> |
|||
</CommandBarButton> |
|||
<CommandBarButton Label="Save"> |
|||
<CommandBarButton.Icon> |
|||
<PathIcon Data="M15,9H5V5H15M12,19A3,3 0 0,1 9,16A3,3 0 0,1 12,13A3,3 0 0,1 15,16A3,3 0 0,1 12,19M17,3H5C3.89,3 3,3.9 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V7L17,3Z" /> |
|||
</CommandBarButton.Icon> |
|||
</CommandBarButton> |
|||
<CommandBarSeparator /> |
|||
<CommandBarToggleButton Label="Bold"> |
|||
<CommandBarToggleButton.Icon> |
|||
<PathIcon Data="M15.6,10.79C17.04,10.07 18,8.64 18,7C18,4.79 16.21,3 14,3H7V21H14.73C16.78,21 18.5,19.37 18.5,17.32C18.5,15.82 17.72,14.53 16.5,13.77C16.2,13.59 15.9,13.44 15.6,13.32V10.79M10,6.5H13C13.83,6.5 14.5,7.17 14.5,8C14.5,8.83 13.83,9.5 13,9.5H10V6.5M13.5,17.5H10V14H13.5C14.33,14 15,14.67 15,15.5C15,16.33 14.33,17.5 13.5,17.5Z" /> |
|||
</CommandBarToggleButton.Icon> |
|||
</CommandBarToggleButton> |
|||
</CommandBar> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- CommandBarButton ControlTheme --> |
|||
<ControlTheme x:Key="{x:Type CommandBarButton}" TargetType="CommandBarButton"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderBrush" Value="Transparent" /> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Padding" Value="8,4" /> |
|||
<Setter Property="Width" Value="68" /> |
|||
<Setter Property="MinHeight" Value="40" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="PART_Border" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<StackPanel x:Name="PART_LayoutRoot" |
|||
Spacing="4" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<ContentPresenter x:Name="PART_IconPresenter" |
|||
Content="{TemplateBinding Icon}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
HorizontalAlignment="Center" /> |
|||
<TextBlock x:Name="PART_Label" |
|||
Text="{TemplateBinding Label}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
FontSize="11" |
|||
HorizontalAlignment="Center" |
|||
TextTrimming="CharacterEllipsis" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Hover --> |
|||
<Style Selector="^:pointerover /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed --> |
|||
<Style Selector="^:pressed /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Compact: hide label, reduce width --> |
|||
<Style Selector="^[IsCompact=True]"> |
|||
<Setter Property="Width" Value="40" /> |
|||
</Style> |
|||
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<!-- LabelPosition=Right: horizontal layout, auto-width --> |
|||
<Style Selector="^[LabelPosition=Right]"> |
|||
<Setter Property="Width" Value="NaN" /> |
|||
<Setter Property="MinWidth" Value="40" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot"> |
|||
<Setter Property="Orientation" Value="Horizontal" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter"> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
|
|||
<!-- IsInOverflow: full-width horizontal layout --> |
|||
<Style Selector="^[IsInOverflow=True]"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="Width" Value="NaN" /> |
|||
<Setter Property="MinHeight" Value="36" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="Orientation" Value="Horizontal" /> |
|||
<Setter Property="Spacing" Value="0" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter"> |
|||
<Setter Property="Width" Value="16" /> |
|||
<Setter Property="Height" Value="16" /> |
|||
<Setter Property="Margin" Value="4,0,10,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- CommandBarToggleButton ControlTheme --> |
|||
<ControlTheme x:Key="{x:Type CommandBarToggleButton}" TargetType="CommandBarToggleButton"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderBrush" Value="Transparent" /> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Padding" Value="8,4" /> |
|||
<Setter Property="Width" Value="68" /> |
|||
<Setter Property="MinHeight" Value="40" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="PART_Border" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<StackPanel x:Name="PART_LayoutRoot" |
|||
Spacing="4" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<ContentPresenter x:Name="PART_IconPresenter" |
|||
Content="{TemplateBinding Icon}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
HorizontalAlignment="Center" /> |
|||
<TextBlock x:Name="PART_Label" |
|||
Text="{TemplateBinding Label}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
FontSize="11" |
|||
HorizontalAlignment="Center" |
|||
TextTrimming="CharacterEllipsis" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Hover --> |
|||
<Style Selector="^:pointerover /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed --> |
|||
<Style Selector="^:pressed /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Checked --> |
|||
<Style Selector="^:checked /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightAccentBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Compact: hide label, reduce width --> |
|||
<Style Selector="^[IsCompact=True]"> |
|||
<Setter Property="Width" Value="40" /> |
|||
</Style> |
|||
<Style Selector="^[IsCompact=True] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<!-- LabelPosition=Right: horizontal layout, auto-width --> |
|||
<Style Selector="^[LabelPosition=Right]"> |
|||
<Setter Property="Width" Value="NaN" /> |
|||
<Setter Property="MinWidth" Value="40" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ StackPanel#PART_LayoutRoot"> |
|||
<Setter Property="Orientation" Value="Horizontal" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ ContentPresenter#PART_IconPresenter"> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[LabelPosition=Right] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
|
|||
<!-- IsInOverflow: full-width horizontal layout --> |
|||
<Style Selector="^[IsInOverflow=True]"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="Width" Value="NaN" /> |
|||
<Setter Property="MinHeight" Value="36" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ StackPanel#PART_LayoutRoot"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="Orientation" Value="Horizontal" /> |
|||
<Setter Property="Spacing" Value="0" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ ContentPresenter#PART_IconPresenter"> |
|||
<Setter Property="Width" Value="16" /> |
|||
<Setter Property="Height" Value="16" /> |
|||
<Setter Property="Margin" Value="4,0,10,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[IsInOverflow=True] /template/ TextBlock#PART_Label"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- CommandBarSeparator ControlTheme --> |
|||
<ControlTheme x:Key="{x:Type CommandBarSeparator}" TargetType="CommandBarSeparator"> |
|||
<Setter Property="Width" Value="1" /> |
|||
<Setter Property="MinHeight" Value="24" /> |
|||
<Setter Property="Margin" Value="8,4" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" |
|||
Width="{TemplateBinding Width}" |
|||
Height="{TemplateBinding Height}" |
|||
MinHeight="{TemplateBinding MinHeight}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- IsInOverflow: horizontal separator --> |
|||
<Style Selector="^[IsInOverflow=True]"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Width" Value="NaN" /> |
|||
<Setter Property="Height" Value="1" /> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="Margin" Value="4,4" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- CommandBar ControlTheme --> |
|||
<ControlTheme x:Key="{x:Type CommandBar}" TargetType="CommandBar"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}" /> |
|||
<Setter Property="MinHeight" Value="48" /> |
|||
<Setter Property="Padding" Value="4,0" /> |
|||
<Setter Property="ItemWidthBottom" Value="70" /> |
|||
<Setter Property="ItemWidthRight" Value="102" /> |
|||
<Setter Property="ItemWidthCollapsed" Value="42" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}" |
|||
MinHeight="{TemplateBinding MinHeight}"> |
|||
<Panel> |
|||
<DockPanel KeyboardNavigation.TabNavigation="Cycle"> |
|||
<!-- Overflow button (docked right) --> |
|||
<Button x:Name="PART_OverflowButton" |
|||
DockPanel.Dock="Right" |
|||
Background="Transparent" |
|||
BorderThickness="0" |
|||
Padding="12,0" |
|||
MinWidth="40" |
|||
VerticalAlignment="Stretch" |
|||
FontSize="16" |
|||
IsVisible="{TemplateBinding IsOverflowButtonVisible}"> |
|||
<PathIcon Width="16" Height="16" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Data="M6,10A2,2 0 0,0 4,12A2,2 0 0,0 6,14A2,2 0 0,0 8,12A2,2 0 0,0 6,10M12,10A2,2 0 0,0 10,12A2,2 0 0,0 12,14A2,2 0 0,0 14,12A2,2 0 0,0 12,10M18,10A2,2 0 0,0 16,12A2,2 0 0,0 18,14A2,2 0 0,0 20,12A2,2 0 0,0 18,10Z" /> |
|||
</Button> |
|||
|
|||
<!-- Custom content area (docked left) --> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
DockPanel.Dock="Left" |
|||
VerticalAlignment="Center" /> |
|||
|
|||
<!-- Primary commands (fills remaining space, right-aligned) --> |
|||
<ItemsControl x:Name="PART_PrimaryCommands" |
|||
ItemsSource="{Binding VisiblePrimaryCommands, RelativeSource={RelativeSource TemplatedParent}}" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Stretch" |
|||
ClipToBounds="True"> |
|||
<ItemsControl.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal" Spacing="2" /> |
|||
</ItemsPanelTemplate> |
|||
</ItemsControl.ItemsPanel> |
|||
</ItemsControl> |
|||
</DockPanel> |
|||
|
|||
<!-- Overflow popup --> |
|||
<Popup x:Name="PART_OverflowPopup" |
|||
IsOpen="{TemplateBinding IsOpen, Mode=TwoWay}" |
|||
PlacementTarget="{Binding #PART_OverflowButton}" |
|||
Placement="Bottom" |
|||
IsLightDismissEnabled="True" |
|||
WindowManagerAddShadowHint="True"> |
|||
<Border Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" |
|||
BorderBrush="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" |
|||
BorderThickness="1" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}" |
|||
Padding="4" |
|||
MinWidth="160"> |
|||
<ItemsControl x:Name="PART_OverflowPresenter" |
|||
ItemsSource="{Binding OverflowItems, RelativeSource={RelativeSource TemplatedParent}}"> |
|||
<ItemsControl.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Spacing="2" /> |
|||
</ItemsPanelTemplate> |
|||
</ItemsControl.ItemsPanel> |
|||
</ItemsControl> |
|||
</Border> |
|||
</Popup> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,42 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<ContentPage Header="Sample Page"> |
|||
<TextBlock Text="Content goes here" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type ContentPage}" TargetType="ContentPage"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlPageBackgroundAltHighBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel> |
|||
<!-- Visibility managed in code-behind --> |
|||
<ContentPresenter Name="PART_TopCommandBar" |
|||
DockPanel.Dock="Top" |
|||
HorizontalContentAlignment="Stretch" |
|||
IsVisible="False" /> |
|||
|
|||
<!-- Visibility managed in code-behind --> |
|||
<ContentPresenter Name="PART_BottomCommandBar" |
|||
DockPanel.Dock="Bottom" |
|||
HorizontalContentAlignment="Stretch" |
|||
IsVisible="False" /> |
|||
|
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,68 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Background="{DynamicResource SystemAccentColor}" |
|||
Margin="16" |
|||
Padding="48" |
|||
Width="400" |
|||
Height="200"> |
|||
<Border.ContextMenu> |
|||
<ContextMenu> |
|||
<MenuItem Header="Standard _Menu Item" /> |
|||
<MenuItem Header="Disabled" IsEnabled="False" /> |
|||
<Separator /> |
|||
<MenuItem Header="Menu with _Submenu"> |
|||
<MenuItem Header="Submenu _1" /> |
|||
<MenuItem Header="Submenu _2" /> |
|||
</MenuItem> |
|||
<MenuItem Header="Menu Item with _Icon" /> |
|||
<MenuItem Header="Menu Item with _Checkbox"> |
|||
<MenuItem.Icon> |
|||
<CheckBox BorderThickness="0" |
|||
IsHitTestVisible="False" |
|||
IsChecked="True" /> |
|||
</MenuItem.Icon> |
|||
</MenuItem> |
|||
</ContextMenu> |
|||
</Border.ContextMenu> |
|||
<TextBlock Text="Defined in XAML" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- Added missing resource --> |
|||
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness> |
|||
|
|||
<ControlTheme x:Key="{x:Type ContextMenu}" TargetType="ContextMenu"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutPresenterBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Focusable" Value="True" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="WindowManagerAddShadowHint" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{TemplateBinding Padding}" |
|||
MaxWidth="{TemplateBinding MaxWidth}" |
|||
MinHeight="{TemplateBinding MinHeight}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ScrollViewer Theme="{StaticResource FluentMenuScrollViewer}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,113 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
xmlns:collections="using:System.Collections" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TextBox Text="Sample"> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception /> |
|||
</DataValidationErrors.Error> |
|||
</TextBox> |
|||
<TextBox Text="Sample"> |
|||
<TextBox.Styles> |
|||
<Style Selector="DataValidationErrors"> |
|||
<Setter Property="Theme" Value="{DynamicResource TooltipDataValidationErrors}" /> |
|||
</Style> |
|||
</TextBox.Styles> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception /> |
|||
</DataValidationErrors.Error> |
|||
</TextBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type DataValidationErrors}" |
|||
TargetType="DataValidationErrors"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate TargetType="DataValidationErrors"> |
|||
<DockPanel LastChildFill="True"> |
|||
<ContentControl x:Name="InlineDataValidationContentControl" |
|||
Margin="0,4,0,0" |
|||
Content="{Binding (DataValidationErrors.Errors)}" |
|||
ContentTemplate="{TemplateBinding ErrorTemplate}" |
|||
DataContext="{TemplateBinding Owner}" |
|||
DockPanel.Dock="Bottom" |
|||
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Padding="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ErrorTemplate"> |
|||
<DataTemplate> |
|||
<ItemsControl x:DataType="DataValidationErrors" |
|||
Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}" |
|||
ItemsSource="{Binding}"> |
|||
<ItemsControl.Styles> |
|||
<Style Selector="TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style> |
|||
</ItemsControl.Styles> |
|||
</ItemsControl> |
|||
</DataTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="TooltipDataValidationErrors" |
|||
TargetType="DataValidationErrors"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate TargetType="DataValidationErrors"> |
|||
<DockPanel LastChildFill="True"> |
|||
<ContentControl Content="{Binding (DataValidationErrors.Errors)}" |
|||
ContentTemplate="{TemplateBinding ErrorTemplate}" |
|||
DataContext="{TemplateBinding Owner}" |
|||
DockPanel.Dock="Right" |
|||
IsVisible="{Binding (DataValidationErrors.HasErrors)}" /> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Padding="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ErrorTemplate"> |
|||
<DataTemplate> |
|||
<Panel Name="PART_InlineErrorTemplatePanel" |
|||
Background="Transparent"> |
|||
<Panel.Styles> |
|||
<Style Selector="Panel#PART_InlineErrorTemplatePanel"> |
|||
<Setter Property="Margin" Value="8,0" /> |
|||
</Style> |
|||
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
|||
</Style> |
|||
<Style Selector="Panel#PART_InlineErrorTemplatePanel ToolTip TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style> |
|||
</Panel.Styles> |
|||
<ToolTip.Tip> |
|||
<ItemsControl ItemsSource="{Binding}" x:DataType="collections:IEnumerable" /> |
|||
</ToolTip.Tip> |
|||
<Path Width="14" |
|||
Height="14" |
|||
Data="M14,7 A7,7 0 0,0 0,7 M0,7 A7,7 0 1,0 14,7 M7,3l0,5 M7,9l0,2" |
|||
Stroke="{DynamicResource SystemControlErrorTextForegroundBrush}" |
|||
StrokeThickness="2" /> |
|||
</Panel> |
|||
</DataTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,262 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Height="500"> |
|||
<StackPanel Spacing="20" VerticalAlignment="Center"> |
|||
<DatePicker /> |
|||
<DatePicker CornerRadius="10" /> |
|||
<DatePicker IsEnabled="False" /> |
|||
<DatePicker> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</DatePicker> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="DatePickerFlyoutPresenterHighlightHeight">40</x:Double> |
|||
<x:Double x:Key="DatePickerFlyoutPresenterItemHeight">40</x:Double> |
|||
<x:Double x:Key="DatePickerFlyoutPresenterAcceptDismissHostGridHeight">41</x:Double> |
|||
<x:Double x:Key="DatePickerThemeMinWidth">296</x:Double> |
|||
<x:Double x:Key="DatePickerThemeMaxWidth">456</x:Double> |
|||
<Thickness x:Key="DatePickerFlyoutPresenterItemPadding">0,3,0,6</Thickness> |
|||
<Thickness x:Key="DatePickerFlyoutPresenterMonthPadding">9,3,0,6</Thickness> |
|||
<Thickness x:Key="DatePickerHostPadding">0,3,0,6</Thickness> |
|||
<Thickness x:Key="DatePickerHostMonthPadding">9,3,0,6</Thickness> |
|||
<x:Double x:Key="DatePickerSpacerThemeWidth">1</x:Double> |
|||
|
|||
<ControlTheme x:Key="FluentDatePickerFlyoutButton" TargetType="Button"> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
CornerRadius="{TemplateBinding CornerRadius}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource DatePickerButtonBackgroundPressed}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource DatePickerButtonForegroundPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerButtonBorderBrushDisabled}"/> |
|||
<Setter Property="Background" Value="{DynamicResource DatePickerButtonBackgroundDisabled}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource DatePickerButtonForegroundDisabled}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type DatePicker}" TargetType="DatePicker"> |
|||
<Setter Property="Foreground" Value="{DynamicResource DatePickerButtonForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource DatePickerButtonBackground}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerButtonBorderBrush}"/> |
|||
<Setter Property="BorderThickness" Value="1"/> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource DatePickerThemeMinWidth}" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource DatePickerThemeMaxWidth}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}"> |
|||
<Button Name="PART_FlyoutButton" |
|||
Theme="{StaticResource FluentDatePickerFlyoutButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsEnabled="{TemplateBinding IsEnabled}" |
|||
MinWidth="{TemplateBinding MinWidth}" |
|||
MaxWidth="{TemplateBinding MaxWidth}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
TemplatedControl.IsTemplateFocusTarget="True"> |
|||
<Grid Name="PART_ButtonContentGrid" ColumnDefinitions="78*,Auto,132*,Auto,78*"> |
|||
<TextBlock Name="PART_DayTextBlock" Text="{DynamicResource StringDatePickerDayText}" HorizontalAlignment="Center" |
|||
Padding="{DynamicResource DatePickerHostPadding}" /> |
|||
<TextBlock Name="PART_MonthTextBlock" Text="{DynamicResource StringDatePickerMonthText}" TextAlignment="Left" |
|||
Padding="{DynamicResource DatePickerHostMonthPadding}" /> |
|||
<TextBlock Name="PART_YearTextBlock" Text="{DynamicResource StringDatePickerYearText}" HorizontalAlignment="Center" |
|||
Padding="{DynamicResource DatePickerHostPadding}" /> |
|||
<Rectangle x:Name="PART_FirstSpacer" |
|||
Fill="{DynamicResource DatePickerSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="1" |
|||
Grid.Column="1" /> |
|||
<Rectangle x:Name="PART_SecondSpacer" |
|||
Fill="{DynamicResource DatePickerSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="1" |
|||
Grid.Column="3" /> |
|||
</Grid> |
|||
</Button> |
|||
|
|||
<Popup Name="PART_Popup" WindowManagerAddShadowHint="False" |
|||
IsLightDismissEnabled="True" PlacementTarget="{TemplateBinding}" |
|||
Placement="Bottom"> |
|||
<DatePickerPresenter Name="PART_PickerPresenter" /> |
|||
</Popup> |
|||
|
|||
</Grid> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:disabled /template/ Rectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource DatePickerSpacerFillDisabled}"/> |
|||
</Style> |
|||
|
|||
<!-- Changes foreground for watermark text when SelectedDate is null--> |
|||
<Style Selector="^:hasnodate /template/ Button#PART_FlyoutButton TextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForeground}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:error /template/ Button#PART_FlyoutButton"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!--WinUI: DatePickerFlyoutPresenter--> |
|||
<ControlTheme x:Key="{x:Type DatePickerPresenter}" TargetType="DatePickerPresenter"> |
|||
<Setter Property="Width" Value="296" /> |
|||
<Setter Property="MinWidth" Value="296" /> |
|||
<Setter Property="MaxHeight" Value="398" /> |
|||
<Setter Property="Background" Value="{DynamicResource DatePickerFlyoutPresenterBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource DatePickerFlyoutPresenterBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource DateTimeFlyoutBorderThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="Background" Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{DynamicResource DateTimeFlyoutBorderPadding}" |
|||
MaxHeight="398" CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid Name="ContentRoot" RowDefinitions="*,Auto"> |
|||
<Grid Name="PART_PickerContainer"> |
|||
<Grid.Styles> |
|||
<Style Selector="DateTimePickerPanel > ListBoxItem"> |
|||
<Setter Property="Theme" Value="{StaticResource FluentDateTimePickerItem}" /> |
|||
</Style> |
|||
</Grid.Styles> |
|||
<!--Column Definitions set in code, ignore here--> |
|||
<Panel Name="PART_MonthHost"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_MonthSelector" |
|||
PanelType="Month" |
|||
ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}" |
|||
ShouldLoop="True" /> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_MonthUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_MonthDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
<Panel Name="PART_DayHost"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_DaySelector" |
|||
PanelType="Day" |
|||
ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}" |
|||
ShouldLoop="True" /> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_DayUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_DayDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
<Panel Name="PART_YearHost"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_YearSelector" |
|||
PanelType="Year" |
|||
ItemHeight="{DynamicResource DatePickerFlyoutPresenterItemHeight}" |
|||
ShouldLoop="False" /> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_YearUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_YearDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
<Rectangle Name="HighlightRect" IsHitTestVisible="False" ZIndex="-1" |
|||
Fill="{DynamicResource DatePickerFlyoutPresenterHighlightFill}" |
|||
Grid.Column="0" Grid.ColumnSpan="5" VerticalAlignment="Center" |
|||
Height="{DynamicResource DatePickerFlyoutPresenterHighlightHeight}" /> |
|||
<Rectangle Name="PART_FirstSpacer" |
|||
Fill="{DynamicResource DatePickerFlyoutPresenterSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource DatePickerSpacerThemeWidth}" |
|||
Grid.Column="1" /> |
|||
<Rectangle Name="PART_SecondSpacer" |
|||
Fill="{DynamicResource DatePickerFlyoutPresenterSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource DatePickerSpacerThemeWidth}" |
|||
Grid.Column="3" /> |
|||
</Grid> |
|||
|
|||
<Grid Name="AcceptDismissGrid" |
|||
Grid.Row="1" |
|||
ColumnDefinitions="*,*"> |
|||
<Rectangle Height="{DynamicResource DatePickerSpacerThemeWidth}" |
|||
VerticalAlignment="Top" |
|||
Fill="{DynamicResource DatePickerFlyoutPresenterSpacerFill}" |
|||
Grid.ColumnSpan="2"/> |
|||
<Button Name="PART_AcceptButton" |
|||
Grid.Column="0" |
|||
Theme="{StaticResource FluentDateTimePickerButton}" |
|||
Height="{DynamicResource DatePickerFlyoutPresenterAcceptDismissHostGridHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<Path Stroke="{Binding $parent[Button].Foreground}" |
|||
StrokeLineCap="Round" |
|||
StrokeThickness="0.75" |
|||
Data="M0.5,8.5 5,13.5 15.5,3" /> |
|||
</Button> |
|||
<Button Name="PART_DismissButton" |
|||
Grid.Column="1" |
|||
Theme="{StaticResource FluentDateTimePickerButton}" |
|||
Height="{DynamicResource DatePickerFlyoutPresenterAcceptDismissHostGridHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<Path Stroke="{Binding $parent[Button].Foreground}" |
|||
StrokeLineCap="Round" |
|||
StrokeThickness="0.75" |
|||
Data="M2,2 14,14 M2,14 14 2" /> |
|||
</Button> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ Panel"> |
|||
<Style Selector="^:pointerover RepeatButton"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,117 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Width="200"> |
|||
<StackPanel Spacing="20"> |
|||
<ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}">Standard Item</ListBoxItem> |
|||
<ListBoxItem Theme="{DynamicResource FluentDateTimePickerItem}" Classes="MonthItem">Month Item</ListBoxItem> |
|||
<RepeatButton Theme="{DynamicResource FluentDateTimePickerButton}">Button</RepeatButton> |
|||
<RepeatButton Theme="{DynamicResource FluentDateTimePickerUpButton}" IsVisible="True"/> |
|||
<RepeatButton Theme="{DynamicResource FluentDateTimePickerDownButton}" IsVisible="True"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- Theme for the items displayed in the selectors --> |
|||
<ControlTheme x:Key="FluentDateTimePickerItem" TargetType="ListBoxItem" BasedOn="{StaticResource {x:Type ListBoxItem}}"> |
|||
<Setter Property="Padding" Value="{DynamicResource DatePickerFlyoutPresenterItemPadding}"/> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
|
|||
<Style Selector="^:selected"> |
|||
<Setter Property="IsHitTestVisible" Value="False"/> |
|||
<Style Selector="^/template/ Rectangle#PressedBackground"> |
|||
<Setter Property="Fill" Value="Transparent"/> |
|||
</Style> |
|||
<Style Selector="^/template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
</Style> |
|||
</Style> |
|||
<Style Selector="^.MonthItem"> |
|||
<Setter Property="Padding" Value="{DynamicResource DatePickerFlyoutPresenterMonthPadding}"/> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- This is used for both the accept/dismiss & repeatbuttons in the presenter--> |
|||
<ControlTheme x:Key="FluentDateTimePickerButton" TargetType="Button"> |
|||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackground}" /> |
|||
<Setter Property="Height" Value="22" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center"/> |
|||
<Setter Property="VerticalContentAlignment" Value="Center"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<!-- |
|||
The background is doubled here for the loopingselector up/down repeat buttons |
|||
that appear opaque. Not sure how MS does it though I suspect this is it |
|||
but source isn't MIT yet, so this is my solution --> |
|||
<Border Background="{TemplateBinding Background}"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{DynamicResource DateTimePickerFlyoutButtonBorderBrush}" |
|||
BorderThickness="{DynamicResource DateTimeFlyoutButtonBorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Foreground="{DynamicResource SystemControlHighlightAltBaseHighBrush}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackgroundPointerOver}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerFlyoutButtonBorderBrushPointerOver}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonForegroundPointerOver}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource DateTimePickerFlyoutButtonBackgroundPressed}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource DateTimePickerFlyoutButtonBorderBrushPressed}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource DateTimePickerFlyoutButtonForegroundPressed}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentDateTimePickerUpButton" TargetType="RepeatButton" BasedOn="{StaticResource FluentDateTimePickerButton}"> |
|||
<Setter Property="VerticalAlignment" Value="Top"/> |
|||
<Setter Property="Height" Value="22" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" /> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
<Setter Property="Content"> |
|||
<Template> |
|||
<Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center"> |
|||
<Path Stroke="{Binding $parent[RepeatButton].Foreground}" StrokeThickness="1" Data="M 0,9 L 9,0 L 18,9"/> |
|||
</Viewbox> |
|||
</Template> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentDateTimePickerDownButton" TargetType="RepeatButton" BasedOn="{StaticResource FluentDateTimePickerButton}"> |
|||
<Setter Property="VerticalAlignment" Value="Bottom"/> |
|||
<Setter Property="Height" Value="22" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" /> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
<Setter Property="Content"> |
|||
<Template> |
|||
<Viewbox Height="10" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center"> |
|||
<Path Stroke="{Binding $parent[RepeatButton].Foreground}" StrokeThickness="1" Data="M 0,0 L 9,9 L 18,0"/> |
|||
</Viewbox> |
|||
</Template> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,259 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<DrawerPage Header="Sample Drawer Page" |
|||
DrawerLength="200" |
|||
IsOpen="True"> |
|||
<ContentPage Header="Drawer Content"> |
|||
<TextBlock Text="Drawer menu" /> |
|||
</ContentPage> |
|||
</DrawerPage> |
|||
</Design.PreviewWith> |
|||
|
|||
<StreamGeometry x:Key="DrawerPaneButtonIcon">M3 17h18a1 1 0 0 1 .117 1.993L21 19H3a1 1 0 0 1-.117-1.993L3 17h18H3Zm0-6 18-.002a1 1 0 0 1 .117 1.993l-.117.007L3 13a1 1 0 0 1-.117-1.993L3 11l18-.002L3 11Zm0-6h18a1 1 0 0 1 .117 1.993L21 7H3a1 1 0 0 1-.117-1.993L3 5h18H3Z</StreamGeometry> |
|||
|
|||
<x:Double x:Key="NavigationControlNavBarHeight">48</x:Double> |
|||
<SolidColorBrush x:Key="NavigationControlNavBarBackground" Color="{DynamicResource SystemChromeMediumColor}" /> |
|||
|
|||
<ControlTheme x:Key="{x:Type DrawerPage}" TargetType="DrawerPage"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlPageBackgroundAltHighBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<SplitView Name="PART_SplitView" |
|||
DisplayMode="{TemplateBinding DisplayMode}" |
|||
OpenPaneLength="{TemplateBinding DrawerLength}" |
|||
CompactPaneLength="{TemplateBinding CompactDrawerLength}" |
|||
PaneBackground="{Binding DrawerBackground, RelativeSource={RelativeSource TemplatedParent}}" |
|||
IsPaneOpen="{Binding IsOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"> |
|||
<SplitView.Pane> |
|||
<DockPanel Background="{TemplateBinding DrawerBackground}"> |
|||
<!-- Compact-mode toggle: visible only in CompactOverlay/CompactInline. --> |
|||
<ToggleButton Name="PART_CompactPaneToggle" |
|||
DockPanel.Dock="Top" |
|||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}" |
|||
Background="Transparent" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Left" |
|||
Width="{TemplateBinding CompactDrawerLength}" |
|||
Height="{TemplateBinding CompactDrawerLength}" |
|||
AutomationProperties.Name="Toggle navigation drawer" |
|||
ToolTip.Tip="Toggle navigation drawer"> |
|||
<Panel> |
|||
<PathIcon |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}" |
|||
Data="{DynamicResource DrawerPaneButtonIcon}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
<ContentPresenter |
|||
Name="PART_CompactPaneIconPresenter" |
|||
Content="{TemplateBinding DrawerIcon}" |
|||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
</Panel> |
|||
</ToggleButton> |
|||
<ContentPresenter Name="PART_DrawerHeader" |
|||
DockPanel.Dock="Top" |
|||
Content="{TemplateBinding DrawerHeader}" |
|||
ContentTemplate="{TemplateBinding DrawerHeaderTemplate}" |
|||
Background="{TemplateBinding DrawerHeaderBackground}" |
|||
IsVisible="{TemplateBinding DrawerHeader, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|||
<ContentPresenter Name="PART_DrawerFooter" |
|||
DockPanel.Dock="Bottom" |
|||
Content="{TemplateBinding DrawerFooter}" |
|||
ContentTemplate="{TemplateBinding DrawerFooterTemplate}" |
|||
Background="{TemplateBinding DrawerFooterBackground}" |
|||
IsVisible="{TemplateBinding DrawerFooter, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|||
<ContentPresenter Name="PART_DrawerPresenter" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
Content="{TemplateBinding Drawer}" |
|||
ContentTemplate="{TemplateBinding DrawerTemplate}" /> |
|||
</DockPanel> |
|||
</SplitView.Pane> |
|||
<Grid HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<DockPanel Name="PART_ContentDock"> |
|||
<Border |
|||
Name="PART_TopBar" |
|||
Padding="5" |
|||
Height="{DynamicResource NavigationControlNavBarHeight}" |
|||
Background="{DynamicResource NavigationControlNavBarBackground}" |
|||
DockPanel.Dock="Top"> |
|||
<DockPanel HorizontalAlignment="Stretch"> |
|||
<DockPanel.Styles> |
|||
<Styles> |
|||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" |
|||
Value="Transparent" /> |
|||
</Style> |
|||
</Styles> |
|||
</DockPanel.Styles> |
|||
<ToggleButton x:Name="PART_PaneButton" |
|||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}" |
|||
Background="Transparent" |
|||
DockPanel.Dock="Left" |
|||
AutomationProperties.Name="Toggle navigation drawer" |
|||
ToolTip.Tip="Toggle navigation drawer"> |
|||
<Panel> |
|||
<PathIcon |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}" |
|||
Data="{DynamicResource DrawerPaneButtonIcon}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
<ContentPresenter |
|||
Name="PART_PaneIconPresenter" |
|||
Content="{TemplateBinding DrawerIcon}" |
|||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
</Panel> |
|||
</ToggleButton> |
|||
<ContentPresenter x:Name="PART_TitlePresenter" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
VerticalAlignment="Center" |
|||
VerticalContentAlignment="Center" |
|||
FontSize="16" |
|||
FontWeight="SemiBold" |
|||
Margin="8,0,0,0" |
|||
IsVisible="{TemplateBinding Header, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
<Border |
|||
Name="PART_BottomBar" |
|||
Padding="5" |
|||
Height="{DynamicResource NavigationControlNavBarHeight}" |
|||
Background="{DynamicResource NavigationControlNavBarBackground}" |
|||
DockPanel.Dock="Bottom" |
|||
IsVisible="False"> |
|||
<DockPanel HorizontalAlignment="Stretch"> |
|||
<DockPanel.Styles> |
|||
<Styles> |
|||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" |
|||
Value="Transparent" /> |
|||
</Style> |
|||
</Styles> |
|||
</DockPanel.Styles> |
|||
<ToggleButton x:Name="PART_BottomPaneButton" |
|||
IsChecked="{Binding #PART_SplitView.IsPaneOpen, Mode=TwoWay}" |
|||
Background="Transparent" |
|||
DockPanel.Dock="Left" |
|||
AutomationProperties.Name="Toggle navigation drawer" |
|||
ToolTip.Tip="Toggle navigation drawer"> |
|||
<Panel> |
|||
<PathIcon |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNull}}" |
|||
Data="{DynamicResource DrawerPaneButtonIcon}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
<ContentPresenter |
|||
Name="PART_BottomPaneIconPresenter" |
|||
Content="{TemplateBinding DrawerIcon}" |
|||
ContentTemplate="{TemplateBinding DrawerIconTemplate}" |
|||
IsVisible="{Binding DrawerIcon, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static ObjectConverters.IsNotNull}}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
</Panel> |
|||
</ToggleButton> |
|||
<ContentPresenter x:Name="PART_BottomTitlePresenter" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
VerticalAlignment="Center" |
|||
VerticalContentAlignment="Center" |
|||
FontSize="16" |
|||
FontWeight="SemiBold" |
|||
Margin="8,0,0,0" |
|||
IsVisible="{TemplateBinding Header, Converter={x:Static ObjectConverters.IsNotNull}}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</DockPanel> |
|||
<Border Name="PART_Backdrop" |
|||
Background="{TemplateBinding BackdropBrush}" |
|||
IsVisible="False" |
|||
IsHitTestVisible="False" /> |
|||
</Grid> |
|||
</SplitView> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:placement-right /template/ ToggleButton#PART_PaneButton"> |
|||
<Setter Property="DockPanel.Dock" Value="Right" /> |
|||
</Style> |
|||
|
|||
<!-- Bottom placement: swap top bar for bottom bar --> |
|||
<Style Selector="^:placement-bottom /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:placement-bottom /template/ Border#PART_BottomBar"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- Bottom placement + compact modes: pane compact strip provides toggle, hide bottom bar --> |
|||
<Style Selector="^:placement-bottom[DisplayMode=CompactOverlay] /template/ Border#PART_BottomBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:placement-bottom[DisplayMode=CompactInline] /template/ Border#PART_BottomBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<!-- Horizontal pane (Bottom/Top): compact toggle must dock Left so drawer content can fill the rest --> |
|||
<Style Selector="^:placement-bottom /template/ ToggleButton#PART_CompactPaneToggle"> |
|||
<Setter Property="DockPanel.Dock" Value="Left" /> |
|||
</Style> |
|||
<Style Selector="^:placement-top /template/ ToggleButton#PART_CompactPaneToggle"> |
|||
<Setter Property="DockPanel.Dock" Value="Left" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DrawerBehavior=Locked] /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DrawerBehavior=Disabled] /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:detail-is-navpage /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DisplayMode=CompactOverlay] /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DisplayMode=CompactOverlay] /template/ ToggleButton#PART_CompactPaneToggle"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DisplayMode=CompactInline] /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[DisplayMode=CompactInline] /template/ ToggleButton#PART_CompactPaneToggle"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[IsInNavigationPage=True] /template/ Border#PART_TopBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<!-- NavigationPage already hosts a hamburger toggle — suppress the compact pane toggle. --> |
|||
<Style Selector="^:detail-is-navpage /template/ ToggleButton#PART_CompactPaneToggle"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,106 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<DropDownButton Content="Click Me!" /> |
|||
<DropDownButton Content="Disabled" IsEnabled="False" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="DropDownButtonMinHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type DropDownButton}" TargetType="DropDownButton"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThemeThickness}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource DropDownButtonMinHeight}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate> |
|||
<Border x:Name="RootBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ClipToBounds="True"> |
|||
<Grid x:Name="InnerGrid"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Grid.Column="0" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
|
|||
<PathIcon x:Name="DropDownGlyph" |
|||
Grid.Column="1" |
|||
UseLayoutRounding="False" |
|||
IsHitTestVisible="False" |
|||
Height="12" |
|||
Width="12" |
|||
Margin="0,0,10,0" |
|||
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" |
|||
Foreground="{DynamicResource ComboBoxDropDownGlyphForeground}"/> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="^:pointerover /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,26 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}"/> |
|||
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<Border Background="{TemplateBinding Background}"> |
|||
<VisualLayerManager Name="PART_VisualLayerManager"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</Border> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,337 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Orientation="Vertical" Spacing="20" Width="350" Height="600"> |
|||
<Expander ExpandDirection="Up" Header="Expand Up"> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
<Expander ExpandDirection="Down" Header="Expand Down"> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
<Expander ExpandDirection="Left" Header="Expand Left"> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
<Expander ExpandDirection="Right" Header="Expand Right"> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
<Expander ExpandDirection="Up"> |
|||
<Expander.Header> |
|||
<Grid ColumnDefinitions="*, Auto"> |
|||
<TextBlock Grid.Column="0" Text="Control" /> |
|||
<TextBlock Grid.Column="1" Text="Header" /> |
|||
</Grid> |
|||
</Expander.Header> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
<Expander ExpandDirection="Up" Header="Rounded" CornerRadius="25"> |
|||
<StackPanel> |
|||
<TextBlock>Expanded content</TextBlock> |
|||
</StackPanel> |
|||
</Expander> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- Shared header/content --> |
|||
<x:Double x:Key="ExpanderMinHeight">48</x:Double> |
|||
|
|||
<!-- Header --> |
|||
<HorizontalAlignment x:Key="ExpanderHeaderHorizontalContentAlignment">Stretch</HorizontalAlignment> |
|||
<VerticalAlignment x:Key="ExpanderHeaderVerticalContentAlignment">Center</VerticalAlignment> |
|||
<Thickness x:Key="ExpanderHeaderPadding">16,0,0,0</Thickness> |
|||
<Thickness x:Key="ExpanderHeaderBorderThickness">1</Thickness> |
|||
<Thickness x:Key="ExpanderChevronBorderThickness">0</Thickness> |
|||
<Thickness x:Key="ExpanderChevronMargin">20,0,8,0</Thickness> |
|||
<x:Double x:Key="ExpanderChevronButtonSize">32</x:Double> |
|||
|
|||
<!-- Content --> |
|||
<Thickness x:Key="ExpanderContentPadding">16</Thickness> |
|||
<Thickness x:Key="ExpanderContentLeftBorderThickness">1,1,0,1</Thickness> |
|||
<Thickness x:Key="ExpanderContentUpBorderThickness">1,1,1,0</Thickness> |
|||
<Thickness x:Key="ExpanderContentRightBorderThickness">0,1,1,1</Thickness> |
|||
<Thickness x:Key="ExpanderContentDownBorderThickness">1,0,1,1</Thickness> |
|||
|
|||
<ControlTheme x:Key="FluentExpanderToggleButtonTheme" TargetType="ToggleButton"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderHeaderBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderHeaderBorderThickness}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ExpanderHeaderForeground}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ExpanderHeaderPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="{DynamicResource ExpanderHeaderHorizontalContentAlignment}" /> |
|||
<Setter Property="VerticalContentAlignment" Value="{DynamicResource ExpanderHeaderVerticalContentAlignment}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="ToggleButtonBackground" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<Grid x:Name="ToggleButtonGrid" |
|||
ColumnDefinitions="*,Auto"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
<Border x:Name="ExpandCollapseChevronBorder" |
|||
Grid.Column="1" |
|||
Width="{DynamicResource ExpanderChevronButtonSize}" |
|||
Height="{DynamicResource ExpanderChevronButtonSize}" |
|||
Margin="{DynamicResource ExpanderChevronMargin}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
BorderBrush="{DynamicResource ExpanderChevronBorderBrush}" |
|||
BorderThickness="{DynamicResource ExpanderChevronBorderThickness}" |
|||
Background="{DynamicResource ExpanderChevronBackground}"> |
|||
<Path x:Name="ExpandCollapseChevron" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
RenderTransformOrigin="50%,50%" |
|||
Stretch="None" |
|||
Stroke="{DynamicResource ExpanderChevronForeground}" |
|||
StrokeThickness="1"> |
|||
<Path.RenderTransform> |
|||
<RotateTransform /> |
|||
</Path.RenderTransform> |
|||
</Path> |
|||
</Border> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^[Tag=expanded] /template/ Path#ExpandCollapseChevron"> |
|||
<Style.Animations> |
|||
<Animation FillMode="Both" Duration="0:0:0.0625"> |
|||
<KeyFrame Cue="100%"> |
|||
<Setter Property="RotateTransform.Angle" Value="180" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
|
|||
<Style Selector="^[Tag=collapsed] /template/ Path#ExpandCollapseChevron"> |
|||
<Style.Animations> |
|||
<Animation FillMode="Both" Duration="0:0:0.0625"> |
|||
<KeyFrame Cue="0%"> |
|||
<Setter Property="RotateTransform.Angle" Value="180" /> |
|||
</KeyFrame> |
|||
<KeyFrame Cue="100%"> |
|||
<Setter Property="RotateTransform.Angle" Value="0" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
|
|||
<!-- PointerOver --> |
|||
<Style Selector="^:pointerover /template/ Border#ToggleButtonBackground"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderHeaderBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ExpanderHeaderForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ Border#ExpandCollapseChevronBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderChevronBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderChevronBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Stroke" Value="{DynamicResource ExpanderChevronForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed --> |
|||
<Style Selector="^:pressed /template/ Border#ToggleButtonBackground"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderHeaderBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrushPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ExpanderHeaderForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Border#ExpandCollapseChevronBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderChevronBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderChevronBorderBrushPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Stroke" Value="{DynamicResource ExpanderChevronForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled --> |
|||
<Style Selector="^:disabled /template/ Border#ToggleButtonBackground"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderHeaderBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderHeaderBorderBrushDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ExpanderHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ Border#ExpandCollapseChevronBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderChevronBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderChevronBorderBrushDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Stroke" Value="{DynamicResource ExpanderChevronForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentExpanderToggleButtonUpTheme" TargetType="ToggleButton" BasedOn="{StaticResource FluentExpanderToggleButtonTheme}"> |
|||
<Style Selector="^ /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Data" Value="M 0 7 L 7 0 L 14 7" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentExpanderToggleButtonDownTheme" TargetType="ToggleButton" BasedOn="{StaticResource FluentExpanderToggleButtonTheme}"> |
|||
<Style Selector="^ /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Data" Value="M 0 0 L 7 7 L 14 0" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentExpanderToggleButtonLeftTheme" TargetType="ToggleButton" BasedOn="{StaticResource FluentExpanderToggleButtonTheme}"> |
|||
<Style Selector="^ /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Data" Value="M 7 0 L 0 7 L 7 14" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentExpanderToggleButtonRightTheme" TargetType="ToggleButton" BasedOn="{StaticResource FluentExpanderToggleButtonTheme}"> |
|||
<Style Selector="^ /template/ Path#ExpandCollapseChevron"> |
|||
<Setter Property="Data" Value="M 0 0 L 7 7 L 0 14" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type Expander}" TargetType="Expander"> |
|||
<Setter Property="IsTabStop" Value="False"/> |
|||
<Setter Property="MinWidth" Value="{DynamicResource FlyoutThemeMinWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource ExpanderMinHeight}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ExpanderContentBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderContentBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderContentDownBorderThickness}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ExpanderContentPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel MinWidth="{TemplateBinding MinWidth}" |
|||
MaxWidth="{TemplateBinding MaxWidth}"> |
|||
<ToggleButton x:Name="ExpanderHeader" |
|||
MinHeight="{TemplateBinding MinHeight}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsEnabled="{TemplateBinding IsEnabled}" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
|||
<Border x:Name="ExpanderContent" |
|||
IsVisible="{TemplateBinding IsExpanded, Mode=TwoWay}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
MinHeight="{TemplateBinding MinHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</Border> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ToggleButton#ExpanderHeader:pressed"> |
|||
<Setter Property="RenderTransform" Value="{x:Null}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:left /template/ ToggleButton#ExpanderHeader, ^:right /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:expanded /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="Tag" Value="expanded" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:not(:expanded) /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="CornerRadius" Value="{Binding $parent[Expander].CornerRadius}" /> |
|||
<Setter Property="Tag" Value="collapsed" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:up /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource BottomCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:up /template/ Border#ExpanderContent"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:down /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource TopCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:down /template/ Border#ExpanderContent"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource BottomCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:left /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:left /template/ Border#ExpanderContent"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:right /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
<Style Selector="^:expanded:right /template/ Border#ExpanderContent"> |
|||
<Setter Property="CornerRadius" Value="{TemplateBinding CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:left /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="DockPanel.Dock" Value="Right" /> |
|||
</Style> |
|||
<Style Selector="^:up /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="DockPanel.Dock" Value="Bottom" /> |
|||
</Style> |
|||
<Style Selector="^:right /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="DockPanel.Dock" Value="Left" /> |
|||
</Style> |
|||
<Style Selector="^:down /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="DockPanel.Dock" Value="Top" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:left /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="Theme" Value="{DynamicResource FluentExpanderToggleButtonLeftTheme}" /> |
|||
</Style> |
|||
<Style Selector="^:up /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="Theme" Value="{DynamicResource FluentExpanderToggleButtonUpTheme}" /> |
|||
</Style> |
|||
<Style Selector="^:right /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="Theme" Value="{DynamicResource FluentExpanderToggleButtonRightTheme}" /> |
|||
</Style> |
|||
<Style Selector="^:down /template/ ToggleButton#ExpanderHeader"> |
|||
<Setter Property="Theme" Value="{DynamicResource FluentExpanderToggleButtonDownTheme}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:left /template/ Border#ExpanderContent"> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderContentLeftBorderThickness}" /> |
|||
</Style> |
|||
<Style Selector="^:up /template/ Border#ExpanderContent"> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderContentUpBorderThickness}" /> |
|||
</Style> |
|||
<Style Selector="^:right /template/ Border#ExpanderContent"> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderContentRightBorderThickness}" /> |
|||
</Style> |
|||
<Style Selector="^:down /template/ Border#ExpanderContent"> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderContentDownBorderThickness}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,87 @@ |
|||
<Styles |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<Styles.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/AdornerLayer.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Button.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CommandBar.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CarouselPage.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ContentPage.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/DrawerPage.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/NavigationPage.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TabbedPage.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/RadioButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Expander.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ProgressBar.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/AutoCompleteBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ButtonSpinner.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Calendar.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CalendarButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CalendarDatePicker.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CalendarDayButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CalendarItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Carousel.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/CheckBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/FlyoutPresenter.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/GroupBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/GridSplitter.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/HyperlinkButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ItemsControl.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Label.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ListBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ListBoxItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/MenuScrollViewer.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Menu.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/MenuItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/MenuFlyoutPresenter.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/NotificationCard.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/NumericUpDown.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/OverlayPopupHost.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/PopupRoot.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/PathIcon.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/PipsPager.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/RepeatButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ScrollBar.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ScrollViewer.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Separator.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/SplitButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/SplitView.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TabControl.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TabItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TabStrip.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TabStripItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TextBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ToggleButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ToggleSwitch.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ToolTip.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TransitioningContentControl.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TreeView.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TreeViewItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/WindowNotificationManager.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Window.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/WindowDrawnDecorations.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ComboBox.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ComboBoxItem.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ContextMenu.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/DataValidationErrors.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/DateTimePickerShared.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/DatePicker.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TimePicker.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/DropDownButton.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/EmbeddableControlRoot.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/Slider.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ManagedFileChooser.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/SelectableTextBlock.xaml"/> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/RefreshContainer.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/RefreshVisualizer.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/ThemeVariantScope.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/HeaderedContentControl.xaml" /> |
|||
<MergeResourceInclude Source="avares://Avalonia.Themes.Fluent2/Controls/TextSelectionHandle.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</Styles.Resources> |
|||
</Styles> |
|||
@ -0,0 +1,42 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Thickness x:Key="FlyoutBorderThemeThickness">1</Thickness> |
|||
<ControlTheme x:Key="{x:Type FlyoutPresenter}" TargetType="FlyoutPresenter"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="Background" Value="{DynamicResource FlyoutPresenterBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource FlyoutBorderThemeBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource FlyoutBorderThemeThickness}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource FlyoutContentThemePadding}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource FlyoutThemeMinWidth}" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource FlyoutThemeMinHeight}" /> |
|||
<Setter Property="MaxHeight" Value="{DynamicResource FlyoutThemeMaxHeight}" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{DynamicResource FlyoutBorderThemePadding}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,23 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type GridSplitter}" TargetType="GridSplitter"> |
|||
<Setter Property="Focusable" Value="True" /> |
|||
<Setter Property="MinWidth" Value="6" /> |
|||
<Setter Property="MinHeight" Value="6" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAltMediumLowColor}" /> |
|||
<Setter Property="PreviewContent"> |
|||
<Template> |
|||
<Rectangle Fill="{DynamicResource SystemAccentColor}" /> |
|||
</Template> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Background="{TemplateBinding Background}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,90 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<GroupBox Padding="10" Margin="10"> |
|||
<TextBlock Text="Hello World" /> |
|||
</GroupBox> |
|||
</Design.PreviewWith> |
|||
<converters:BorderGapMaskConverter x:Key="BorderGapMaskConverter" /> |
|||
|
|||
<ControlTheme x:Key="{x:Type GroupBox}" |
|||
TargetType="GroupBox"> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource GroupBoxBorderThickness}" /> |
|||
<Setter Property="Background" Value="{DynamicResource GroupBoxBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource GroupBoxBorderBrush}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource GroupBoxPadding}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="RootGrid" UseLayoutRounding="true" ColumnDefinitions="6,Auto,*,6" RowDefinitions="Auto,Auto,*,6"> |
|||
<!-- Separate Border for the background because if the background is set in the Border with the Header the opacity mask will be applied to the background as well. --> |
|||
<Border Grid.Row="1" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="4" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="Transparent" |
|||
Background="{TemplateBinding Background}"/> |
|||
|
|||
<Border Grid.Row="1" |
|||
Grid.RowSpan="3" |
|||
Grid.ColumnSpan="4" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="{TemplateBinding BorderBrush}"> |
|||
<Border.OpacityMask> |
|||
<MultiBinding Converter="{StaticResource BorderGapMaskConverter}" |
|||
ConverterParameter="6"> |
|||
<Binding ElementName="Header" |
|||
Path="Bounds.Width"/> |
|||
<Binding RelativeSource="{RelativeSource Self}" |
|||
Path="Bounds.Width"/> |
|||
<Binding RelativeSource="{RelativeSource Self}" |
|||
Path="Bounds.Height"/> |
|||
</MultiBinding> |
|||
</Border.OpacityMask> |
|||
</Border> |
|||
|
|||
<!-- ContentPresenter for the header --> |
|||
<Border x:Name="Header" |
|||
Padding="3,0,3,0" |
|||
Grid.Row="0" |
|||
Grid.RowSpan="2" |
|||
Grid.Column="1"> |
|||
<ContentPresenter Name="PART_HeaderPresenter" |
|||
Content="{TemplateBinding Header}" |
|||
FontSize="{DynamicResource GroupBoxHeaderFontSize}" |
|||
Foreground="{DynamicResource GroupBoxHeaderForeground}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
UseLayoutRounding="{TemplateBinding UseLayoutRounding}" /> |
|||
</Border> |
|||
<!-- Primary content for GroupBox --> |
|||
<ContentPresenter Grid.Row="2" |
|||
Grid.Column="1" |
|||
Grid.ColumnSpan="2" |
|||
Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
UseLayoutRounding="{TemplateBinding UseLayoutRounding}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,42 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type HeaderedContentControl}" |
|||
TargetType="HeaderedContentControl"> |
|||
|
|||
<Setter Property="Padding" Value="3" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Background="{TemplateBinding Background}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Grid RowDefinitions="auto *"> |
|||
<ContentPresenter Name="PART_HeaderPresenter" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Grid.Row="0" /> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Grid.Row="1" /> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,91 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<HyperlinkButton Content="_Click Me!" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="HyperlinkButtonBorderThemeThickness">1</Thickness> |
|||
|
|||
<ControlTheme x:Key="{x:Type HyperlinkButton}" TargetType="HyperlinkButton"> |
|||
<Setter Property="Cursor" Value="Hand" /> |
|||
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackground}" /> |
|||
<Setter Property="BackgroundSizing" Value="OuterBorderEdge" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource HyperlinkButtonBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="TextBlock.TextDecorations" Value="Underline" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.075" /> |
|||
</Transitions> |
|||
</Setter> |
|||
|
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BackgroundSizing="{TemplateBinding BackgroundSizing}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource HyperlinkButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource HyperlinkButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:visited"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundVisited}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundVisitedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource HyperlinkButtonForegroundVisitedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,18 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type ItemsControl}" TargetType="ItemsControl"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,26 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<ControlTheme x:Key="{x:Type Label}" TargetType="Label"> |
|||
<Setter Property="Padding" Value="3"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,50 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<ListBox> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
</ListBox> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type ListBox}" TargetType="ListBox"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ListBoxBorderThemeThickness}" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> |
|||
<Setter Property="ScrollViewer.IsScrollInertiaEnabled" Value="True" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="border" |
|||
ClipToBounds="{TemplateBinding ClipToBounds}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ScrollViewer Name="PART_ScrollViewer" |
|||
VerticalSnapPointsType="{TemplateBinding (ScrollViewer.VerticalSnapPointsType)}" |
|||
HorizontalSnapPointsType="{TemplateBinding (ScrollViewer.HorizontalSnapPointsType)}" |
|||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|||
IsScrollInertiaEnabled="{TemplateBinding (ScrollViewer.IsScrollInertiaEnabled)}" |
|||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}" |
|||
BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,78 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="0"> |
|||
<ListBox> |
|||
<ListBoxItem IsEnabled="False">Disabled</ListBoxItem> |
|||
<ListBoxItem Background="#66000000" |
|||
Padding="20"> |
|||
Test |
|||
</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
</ListBox> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Thickness x:Key="ListBoxItemPadding">12,9,12,12</Thickness> |
|||
<ControlTheme x:Key="{x:Type ListBoxItem}" TargetType="ListBoxItem"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ListBoxItemPadding}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected State --> |
|||
<Style Selector="^:selected"> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Unfocused State --> |
|||
<Style Selector="^:not(:focus) /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected PointerOver State --> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Pressed State --> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,389 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:dialogs="using:Avalonia.Dialogs" |
|||
xmlns:internal="using:Avalonia.Dialogs.Internal" |
|||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Width="800" Height="500"> |
|||
<dialogs:ManagedFileChooser/> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooser}" TargetType="dialogs:ManagedFileChooser"> |
|||
<ControlTheme.Resources> |
|||
<ResourceDictionary> |
|||
<GradientStops x:Key="IconRes.FolderBackGradientStops"> |
|||
</GradientStops> |
|||
<GradientStops x:Key="IconRes.FolderFrontGradientStops"> |
|||
<GradientStop Offset="0" Color="#FFFFDA6F"/> |
|||
<GradientStop Offset="1" Color="#FFFEC326"/> |
|||
</GradientStops> |
|||
<DrawingGroup x:Key="LevelUp"> |
|||
<GeometryDrawing Brush="#00FFFFFF" Geometry="F1M16,16L0,16 0,0 16,0z" /> |
|||
<GeometryDrawing Brush="#FFF6F6F6" Geometry="F1M14.5,0L6.39,0 5.39,2 2.504,2C1.677,2,1,2.673,1,3.5L1,10.582 1,10.586 1,15.414 3,13.414 3,16 7,16 7,13.414 9,15.414 9,13 14.5,13C15.327,13,16,12.327,16,11.5L16,1.5C16,0.673,15.327,0,14.5,0" /> |
|||
<GeometryDrawing Brush="#FFDCB679" Geometry="F1M14,3L7.508,3 8.008,2 8.012,2 14,2z M14.5,1L7.008,1 6.008,3 2.504,3C2.227,3,2,3.224,2,3.5L2,9.582 4.998,6.586 9,10.586 9,12 14.5,12C14.775,12,15,11.776,15,11.5L15,1.5C15,1.224,14.775,1,14.5,1" /> |
|||
<GeometryDrawing Brush="#FF00529C" Geometry="F1M8,11L5,8 2,11 2,13 4,11 4,15 6,15 6,11 8,13z" /> |
|||
<GeometryDrawing Brush="#FFF0EFF1" Geometry="F1M8.0001,1.9996L7.5001,3.0006 14.0001,3.0006 14.0001,1.9996z" /> |
|||
</DrawingGroup> |
|||
<internal:ResourceSelectorConverter x:Key="Icons"> |
|||
<DrawingGroup x:Key="Icon_Folder"> |
|||
<GeometryDrawing Geometry="M 0 0 L 16 16"/> |
|||
<GeometryDrawing Geometry="M 0 3 C 0,1 0,1 2,1 L 5 1 C 5.5,1 6,1 6.5,1.5 L 8 3 L 14 3 C 16,3 16,3 16,5 |
|||
L 16,12 C 16,14 16,14 14,14 |
|||
L 2,14 C 0,14 0,14 0,12 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="1,4" EndPoint="23,20"> |
|||
<GradientStop Offset="0" Color="#FFFFC018"/> |
|||
<GradientStop Offset="1" Color="#FFDFA32D"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 0 4.5 L 8 4.5 L 8 9 L 0 9 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="0,4.5" EndPoint="0,5"> |
|||
<GradientStop Offset="0" Color="#00D7A018"/> |
|||
<GradientStop Offset="1" Color="#7FD7A018"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 0 9 C 0,5 0,5 2,5 L 5 5 C 5.5,5 6,5 6.5,4.75 L 8 4 L 14 4 C 16,4 16,4 16,6 |
|||
L 16,11 C 16,13 16,13 14,13 |
|||
L 2,13 C 0,13 0,13 0,11 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="1,6" EndPoint="23,19"> |
|||
<GradientStop Offset="0" Color="#FFFFE69D"/> |
|||
<GradientStop Offset="1" Color="#FFFFC937"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 0 9 C 0,5 0,5 2,5 L 5 5 C 5.5,5 6,5 6.5,4.75 L 8 4 L 14 4 |
|||
L 8 4.25 C 6,5.25 5.5,5.25 5.125,5.25 L 2 5.25 C 0,5.25 0,5.25 0,9.25 z" Brush="#7FFFFFFF"/> |
|||
</DrawingGroup> |
|||
<DrawingGroup x:Key="Icon_File"> |
|||
<GeometryDrawing Geometry="M 0 0 L 16 16"/> |
|||
<GeometryDrawing Geometry="M 2 0 L 10 0 L 14 4 L 14 16 L 2 16 Z" Brush="#FF797774"/> |
|||
<GeometryDrawing Geometry="M 3 1 L 9.7 1 L 13 4.3 L 13 15 L 3 15 Z" Brush="#FFFAFAFA"/> |
|||
<GeometryDrawing Geometry="L 9 1 L 9 5 L 14 5 L 14 4 L 10 4 L 10 1 Z" Brush="#FF797774"/> |
|||
</DrawingGroup> |
|||
<DrawingGroup x:Key="Icon_Volume"> |
|||
<GeometryDrawing Geometry="M 0 0 L 16 16"/> |
|||
<GeometryDrawing Geometry="M 4 5 L 12 5 L 14.5 7.5 C 15,8 15,8 15,9 L 1 9 C 1,8 1,8 1.5 7.5 Z" Brush="#FFE1E3E6"/> |
|||
<GeometryDrawing Geometry="M 12 5 L 14.5 7.5 C 15,8 15,8 15,9 L 10 9 L 10 5 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="12,5" EndPoint="11.5,5.5"> |
|||
<GradientStop Offset="0" Color="#FFCDCFD1"/> |
|||
<GradientStop Offset="1" Color="#00CDCFD1"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 4 5 L 1.5 7.5 C 1,8 1,8 1,9 L 4 9 L 6 9 L 6 5 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="4,5" EndPoint="4.5,5.5"> |
|||
<GradientStop Offset="0" Color="#FFCDCFD1"/> |
|||
<GradientStop Offset="1" Color="#00CDCFD1"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 1 9 C 1,8 1,8 2,8 L 14 8 |
|||
C 15,8 15,8 15,9 L 15 11 |
|||
C 15,12 15,12 14,12 L 2 12 |
|||
C 1,12 1,12 1,11 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="0,8" EndPoint="0,12"> |
|||
<GradientStop Offset="0" Color="#FF737374"/> |
|||
<GradientStop Offset="1" Color="#FFA8A8A8"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 2 9 C 2,8 2,8 3,8 L 13 8 |
|||
C 14,8 14,8 14,9 L 14 10 |
|||
C 14,11 14,11 13,11 L 3 11 |
|||
C 2,11 2,11 2,10 Z"> |
|||
<GeometryDrawing.Brush> |
|||
<LinearGradientBrush StartPoint="0,8" EndPoint="0,11"> |
|||
<GradientStop Offset="0" Color="#FF333333"/> |
|||
<GradientStop Offset="1" Color="#FF5A5A5A"/> |
|||
</LinearGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing> |
|||
<GeometryDrawing.Geometry> |
|||
<EllipseGeometry Rect="2.5,8.5,2,2"/> |
|||
</GeometryDrawing.Geometry> |
|||
<GeometryDrawing.Brush> |
|||
<RadialGradientBrush GradientOrigin="3.5,9.5" Center="3.5,9.5"> |
|||
<GradientStop Offset="0.8" Color="#4001FF01"/> |
|||
<GradientStop Offset="1" Color="#0001FF01"/> |
|||
</RadialGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing> |
|||
<GeometryDrawing.Geometry> |
|||
<EllipseGeometry Rect="3,9,1,1"/> |
|||
</GeometryDrawing.Geometry> |
|||
<GeometryDrawing.Brush> |
|||
<RadialGradientBrush GradientOrigin="3.5,9.5" Center="3.25,9.75"> |
|||
<GradientStop Offset="0" Color="#FFB6FFB6"/> |
|||
<GradientStop Offset="1" Color="#FF01FF01"/> |
|||
</RadialGradientBrush> |
|||
</GeometryDrawing.Brush> |
|||
</GeometryDrawing> |
|||
<GeometryDrawing Geometry="M 3.23483495705 9.76516504295 A 0.375,0.375 180 1 0 3.76516504295,9.23483495705 A 0.4375,0.4375 135 0 1 3.23483495705,9.76516504295 Z" Brush="#FF00B300"/> |
|||
</DrawingGroup> |
|||
</internal:ResourceSelectorConverter> |
|||
</ResourceDictionary> |
|||
</ControlTheme.Resources> |
|||
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}"/> |
|||
<Setter Property="Template" |
|||
x:DataType="internal:ManagedFileChooserViewModel"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<DockPanel> |
|||
<ListBox x:Name="PART_QuickLinks" DockPanel.Dock="Left" ItemsSource="{Binding QuickLinks}" SelectedIndex="{Binding QuickLinksSelectedIndex}" Focusable="False" |
|||
MaxWidth="200"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent"> |
|||
<Image Width="16" Height="16"> |
|||
<Image.Source> |
|||
<DrawingImage Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
</Image.Source> |
|||
</Image> |
|||
<TextBlock Text="{Binding DisplayName}"/> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
<DockPanel x:Name="NavBar" DockPanel.Dock="Top" Margin="8,5,8,0" VerticalAlignment="Center"> |
|||
<Rectangle Fill="{DynamicResource SystemControlHighlightAltBaseMediumLowBrush}" Height="1" Margin="0,5,0,0" DockPanel.Dock="Bottom"/> |
|||
<DockPanel Margin="4,0"> |
|||
<Button Command="{Binding GoUp}" DockPanel.Dock="Left" Margin="0,0,8,0"> |
|||
<Path Data="M 0 7 L 7 0 L 14 7 M 7 0 L 7 16" Stroke="{CompiledBinding $parent[Button].Foreground}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,-1"/> |
|||
</Button> |
|||
<Button Command="{Binding Refresh}" DockPanel.Dock="Right" Margin="8,0,0,0"> |
|||
<Path Data="M18.62 3.32c.39 0 .7.29.76.66v3c0 .39-.28.7-.66.76h-3a.77.77 0 0 1-.1-1.52h1.08a7.42 7.42 0 1 0 2.65 4.37.77.77 0 1 1 1.5-.3 8.94 8.94 0 1 1-3-5.12V4.09c0-.43.35-.77.77-.77Z" |
|||
Fill="{CompiledBinding $parent[Button].Foreground}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="-2,-4,0,0"/> |
|||
</Button> |
|||
<TextBox x:Name="Location" Text="{Binding Location}"> |
|||
<TextBox.KeyBindings> |
|||
<KeyBinding Command="{Binding EnterPressed}" Gesture="Enter"/> |
|||
</TextBox.KeyBindings> |
|||
</TextBox> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
<DockPanel Margin="8,0,8,5" DockPanel.Dock="Bottom"> |
|||
<Rectangle Fill="{DynamicResource SystemControlHighlightAltBaseMediumLowBrush}" Height="1" Margin="0,0,0,5" DockPanel.Dock="Top"/> |
|||
<DockPanel Margin="4,0"> |
|||
<DockPanel DockPanel.Dock="Top" Margin="0,0,0,4"> |
|||
<ComboBox DockPanel.Dock="Right" |
|||
IsVisible="{Binding ShowFilters}" |
|||
ItemsSource="{Binding Filters}" |
|||
SelectedItem="{Binding SelectedFilter}" /> |
|||
<TextBox Text="{Binding FileName}" PlaceholderText="{DynamicResource StringManagedFileChooserFileNamePlaceholder}" IsVisible="{Binding !SelectingFolder}" /> |
|||
</DockPanel> |
|||
<CheckBox IsChecked="{Binding ShowHiddenFiles}" Content="{DynamicResource StringManagedFileChooserShowHiddenFilesText}" DockPanel.Dock="Left"/> |
|||
<UniformGrid x:Name="Finalize" HorizontalAlignment="Right" Rows="1"> |
|||
<Button Command="{Binding Ok}" MinWidth="80" Content="{DynamicResource StringManagedFileChooserOkText}" /> |
|||
<Button Command="{Binding Cancel}" MinWidth="80" Content="{DynamicResource StringManagedFileChooserCancelText}" /> |
|||
</UniformGrid> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
|
|||
<DockPanel Grid.IsSharedSizeScope="True"> |
|||
<Grid DockPanel.Dock="Top" Margin="15 5 0 0" HorizontalAlignment="Stretch"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="20" SharedSizeGroup="Icon" /> |
|||
<ColumnDefinition Width="275" SharedSizeGroup="Name" /> |
|||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition Width="200" SharedSizeGroup="Modified" /> |
|||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition Width="150" SharedSizeGroup="Type" /> |
|||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition Width="200" SharedSizeGroup="Size" /> |
|||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" /> |
|||
</Grid.ColumnDefinitions> |
|||
<Grid.Styles> |
|||
<Style Selector="GridSplitter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightAltBaseMediumLowBrush}"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border VerticalAlignment="Stretch" BorderThickness="0" Background="#01000000"> |
|||
<Rectangle Width="1" VerticalAlignment="Stretch" Fill="{TemplateBinding Background}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Grid.Styles> |
|||
<TextBlock Grid.Column="1" Text="{DynamicResource StringManagedFileChooserNameColumn}" /> |
|||
<GridSplitter Grid.Column="2" /> |
|||
<TextBlock Grid.Column="3" Text="{DynamicResource StringManagedFileChooserDateModifiedColumn}" /> |
|||
<GridSplitter Grid.Column="4" /> |
|||
<TextBlock Grid.Column="5" Text="{DynamicResource StringManagedFileChooserTypeColumn}" /> |
|||
<GridSplitter Grid.Column="6" /> |
|||
<TextBlock Grid.Column="7" Text="{DynamicResource StringManagedFileChooserSizeColumn}" /> |
|||
<GridSplitter Grid.Column="8" /> |
|||
</Grid> |
|||
<ListBox x:Name="PART_Files" |
|||
ItemsSource="{Binding Items}" |
|||
Margin="0 5" |
|||
SelectionMode="{Binding SelectionMode}" |
|||
SelectedItems="{Binding SelectedItems}" |
|||
Background="Transparent" |
|||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate x:DataType="internal:ManagedFileChooserItemViewModel"> |
|||
<Grid Background="Transparent"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition SharedSizeGroup="Icon" /> |
|||
<ColumnDefinition SharedSizeGroup="Name" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Modified" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Type" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Size" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
</Grid.ColumnDefinitions> |
|||
<Image Width="16" Height="16"> |
|||
<Image.Source> |
|||
<DrawingImage Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
</Image.Source> |
|||
</Image> |
|||
<TextBlock Grid.Column="1" Text="{Binding DisplayName}"/> |
|||
<TextBlock Grid.Column="3" Text="{Binding Modified}" /> |
|||
<TextBlock Grid.Column="5" Text="{Binding Type}" /> |
|||
<TextBlock Grid.Column="7" HorizontalAlignment="Right"> |
|||
<TextBlock.Text> |
|||
<Binding Path="Size"> |
|||
<Binding.Converter> |
|||
<internal:FileSizeStringConverter/> |
|||
</Binding.Converter> |
|||
</Binding> |
|||
</TextBlock.Text> |
|||
</TextBlock> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^ /template/ ListBox#QuickLinks"> |
|||
<Setter Property="Margin" Value="0"/> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundChromeMediumBrush}"/> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
<Setter Property="Width" Value="240"/> |
|||
<Setter Property="Padding" Value="0,20"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="border" BoxShadow="inset -6 0 3 -3 #20000000" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"> |
|||
<ScrollViewer Name="PART_ScrollViewer" HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ItemContainerTheme"> |
|||
<ControlTheme TargetType="ListBoxItem"> |
|||
<Setter Property="Height" Value="32"/> |
|||
<Setter Property="Padding" Value="30,6"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border x:Name="LayoutRoot" CornerRadius="2" Margin="10,0"> |
|||
<Panel> |
|||
<Border x:Name="SelectedLine" HorizontalAlignment="Left" Margin="2,6" CornerRadius="0.5" Width="3" Background="{DynamicResource SystemControlHighlightAccentBrush}" IsVisible="{TemplateBinding IsSelected}"/> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="Transparent" |
|||
BorderBrush="Transparent" |
|||
BorderThickness="0" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
|||
|
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumBrush}"/> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumHighBrush}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ DockPanel#NavBar Button, ^ /template/ DockPanel#NavBar TextBox"> |
|||
<Setter Property="Height" Value="30"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ DockPanel#NavBar Button"> |
|||
<Setter Property="VerticalAlignment" Value="Stretch"/> |
|||
<Setter Property="Width" Value="40"/> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ DockPanel#NavBar Button:not(:pointerover):not(:pressed)"> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ UniformGrid#Finalize > Button"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center"/> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
<Setter Property="Margin" Value="4,0,0,0"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type dialogs:ManagedFileChooserOverwritePrompt}" TargetType="dialogs:ManagedFileChooserOverwritePrompt"> |
|||
<Setter Property="MinWidth" Value="270" /> |
|||
<Setter Property="MaxWidth" Value="400" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<StackPanel Spacing="10"> |
|||
<TextBlock TextWrapping="Wrap"> |
|||
<TextBlock.Text> |
|||
<MultiBinding> |
|||
<MultiBinding.Converter> |
|||
<converters:StringFormatConverter /> |
|||
</MultiBinding.Converter> |
|||
<DynamicResource ResourceKey="StringManagedFileChooserOverwritePromptFileAlreadyExistsText"/> |
|||
<Binding Path ="FileName" RelativeSource="{RelativeSource TemplatedParent}" /> |
|||
</MultiBinding> |
|||
</TextBlock.Text> |
|||
</TextBlock> |
|||
<StackPanel HorizontalAlignment="Right" |
|||
Spacing="10" |
|||
Orientation="Horizontal"> |
|||
<Button Classes="accent" Content="{DynamicResource StringManagedFileChooserOverwritePromptConfirmText}" |
|||
MinWidth="80" |
|||
HorizontalContentAlignment="Center" |
|||
IsDefault="True" |
|||
Command="{Binding Confirm, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
<Button Content="{DynamicResource StringManagedFileChooserOverwritePromptCancelText}" |
|||
MinWidth="80" |
|||
IsCancel="True" |
|||
HorizontalContentAlignment="Center" |
|||
Command="{Binding Cancel, RelativeSource={RelativeSource TemplatedParent}}" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,114 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Menu> |
|||
<MenuItem Header="_Standard" /> |
|||
<MenuItem Header="Selected" IsSelected="True" /> |
|||
<MenuItem Header="Disabled" IsEnabled="False" /> |
|||
</Menu> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="MenuBarHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="FluentTopLevelMenuItem" TargetType="MenuItem"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" /> |
|||
<!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. --> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuBarItemPadding}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="PART_LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Panel> |
|||
<ContentPresenter Name="PART_HeaderPresenter" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Stretch" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
<Popup Name="PART_Popup" |
|||
WindowManagerAddShadowHint="False" |
|||
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|||
IsLightDismissEnabled="True" |
|||
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}" |
|||
Placement="BottomEdgeAlignedLeft" |
|||
OverlayInputPassThroughElement="{Binding $parent[Menu]}"> |
|||
<Border Background="{DynamicResource MenuFlyoutPresenterBackground}" |
|||
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}" |
|||
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" |
|||
Padding="{DynamicResource MenuFlyoutPresenterThemePadding}" |
|||
MaxWidth="{DynamicResource FlyoutThemeMaxWidth}" |
|||
MinHeight="{DynamicResource MenuFlyoutThemeMinHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ScrollViewer Theme="{StaticResource FluentMenuScrollViewer}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Popup> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Listen for PART_LayoutRoot:pointerover, so it will not be triggered when subitem is pressed --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPressed}" /> |
|||
<Style Selector="^ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type Menu}" TargetType="Menu"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Height" Value="{DynamicResource MenuBarHeight}" /> |
|||
<Setter Property="ItemContainerTheme" Value="{StaticResource FluentTopLevelMenuItem}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
HorizontalAlignment="Stretch" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
VerticalAlignment="Stretch" |
|||
KeyboardNavigation.TabNavigation="Continue" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,43 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type MenuFlyoutPresenter}" TargetType="MenuFlyoutPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutPresenterBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutPresenterBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Padding="{DynamicResource FlyoutBorderThemePadding}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|||
Theme="{StaticResource FluentMenuScrollViewer}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
<ControlTheme x:Key="HorizontalMenuFlyoutPresenter" TargetType="MenuFlyoutPresenter" BasedOn="{StaticResource {x:Type MenuFlyoutPresenter}}"> |
|||
<Setter Property="MinWidth" Value="{DynamicResource HorizontalMenuFlyoutThemeMinWidth}" /> |
|||
<Setter Property="ItemsPanel"> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="Horizontal"/> |
|||
</ItemsPanelTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,261 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:conv="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Width="320"> |
|||
<StackPanel Spacing="20" HorizontalAlignment="Left"> |
|||
<MenuItem Header="_Standard"/> |
|||
<MenuItem IsSelected="True" Header="Selected"/> |
|||
<MenuItem Header="With Icon"> |
|||
<MenuItem.Icon> |
|||
<TextBlock>😊</TextBlock> |
|||
</MenuItem.Icon> |
|||
</MenuItem> |
|||
<MenuItem Header="With CheckBox"> |
|||
<MenuItem.Icon> |
|||
<CheckBox IsChecked="True"/> |
|||
</MenuItem.Icon> |
|||
</MenuItem> |
|||
<MenuItem Header="Input Gesture" InputGesture="Ctrl+G"/> |
|||
<MenuItem Header="Disabled" IsEnabled="False"/> |
|||
<MenuItem Header="-"/> |
|||
<MenuItem Header="Parent" IsSubMenuOpen="True"> |
|||
<MenuItem Header="Child 1"/> |
|||
<MenuItem Header="Child 2"/> |
|||
<MenuItem Header="Child 3"/> |
|||
<Separator/> |
|||
<MenuItem Header="Child 4"/> |
|||
<MenuItem Header="Child 5"/> |
|||
<MenuItem Header="Child 6"/> |
|||
<MenuItem Header="Child 7"/> |
|||
<MenuItem Header="Child 8"/> |
|||
<MenuItem Header="Child 9"/> |
|||
<MenuItem Header="Child 10"/> |
|||
<MenuItem Header="Child 11"/> |
|||
<MenuItem Header="Child 12"/> |
|||
<MenuItem Header="Child 13"/> |
|||
<MenuItem Header="Child 14"/> |
|||
<MenuItem Header="Child 15"/> |
|||
<MenuItem Header="Child 16"/> |
|||
<MenuItem Header="Child 17"/> |
|||
<MenuItem Header="Child 18"/> |
|||
<MenuItem Header="Child 19"/> |
|||
</MenuItem> |
|||
<MenuItem Header="Disabled Parent" IsEnabled="False"> |
|||
<MenuItem Header="Child"/> |
|||
</MenuItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<conv:PlatformKeyGestureConverter x:Key="KeyGestureConverter" /> |
|||
<x:Double x:Key="MenuFlyoutSubItemPopupHorizontalOffset">-4</x:Double> |
|||
<Thickness x:Key="MenuIconPresenterMargin">0,0,12,0</Thickness> |
|||
<Thickness x:Key="MenuInputGestureTextMargin">24,0,0,0</Thickness> |
|||
<StreamGeometry x:Key="MenuItemChevronPathData">M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z</StreamGeometry> |
|||
|
|||
<ControlTheme x:Key="{x:Type MenuItem}" TargetType="MenuItem"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" /> |
|||
<!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. --> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePaddingNarrow}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_LayoutRoot" |
|||
Padding="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" |
|||
SharedSizeGroup="ToggleIcon" /> |
|||
<ColumnDefinition Width="Auto" |
|||
SharedSizeGroup="MenuItemIcon" /> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" |
|||
SharedSizeGroup="MenuItemIGT" /> |
|||
<ColumnDefinition Width="Auto" |
|||
SharedSizeGroup="MenuItemChevron" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<ContentControl Grid.Column="0" |
|||
x:Name="PART_ToggleIconPresenter" |
|||
IsVisible="False" |
|||
Theme="{StaticResource FluentMenuItemIconTheme}" |
|||
Margin="{DynamicResource MenuIconPresenterMargin}" /> |
|||
|
|||
<ContentControl Grid.Column="1" |
|||
x:Name="PART_IconPresenter" |
|||
IsVisible="False" |
|||
Theme="{StaticResource FluentMenuItemIconTheme}" |
|||
Content="{TemplateBinding Icon}" |
|||
Margin="{DynamicResource MenuIconPresenterMargin}" /> |
|||
|
|||
<ContentPresenter Name="PART_HeaderPresenter" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Stretch" |
|||
Grid.Column="2"/> |
|||
<TextBlock x:Name="PART_InputGestureText" |
|||
Grid.Column="3" |
|||
Margin="{DynamicResource MenuInputGestureTextMargin}" |
|||
Text="{TemplateBinding InputGesture, Converter={StaticResource KeyGestureConverter}}" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" |
|||
Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"/> |
|||
<Path Name="PART_ChevronPath" |
|||
Stretch="Uniform" |
|||
Width="8" |
|||
Height="16" |
|||
Data="{StaticResource MenuItemChevronPathData}" |
|||
Fill="{DynamicResource MenuFlyoutSubItemChevron}" |
|||
Margin="{DynamicResource MenuFlyoutItemChevronMargin}" |
|||
VerticalAlignment="Center" |
|||
Grid.Column="4" /> |
|||
</Grid> |
|||
</Border> |
|||
<Popup Name="PART_Popup" |
|||
WindowManagerAddShadowHint="False" |
|||
Placement="RightEdgeAlignedTop" |
|||
HorizontalOffset="{DynamicResource MenuFlyoutSubItemPopupHorizontalOffset}" |
|||
IsLightDismissEnabled="False" |
|||
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}"> |
|||
<Border Background="{DynamicResource MenuFlyoutPresenterBackground}" |
|||
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}" |
|||
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" |
|||
Padding="{DynamicResource MenuFlyoutPresenterThemePadding}" |
|||
MaxWidth="{DynamicResource FlyoutThemeMaxWidth}" |
|||
MinHeight="{DynamicResource MenuFlyoutThemeMinHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ScrollViewer Theme="{StaticResource FluentMenuScrollViewer}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Popup> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:icon /template/ ContentControl#PART_IconPresenter"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
<Style Selector="^:selected"> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PART_InputGestureText"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Path#PART_ChevronPath"> |
|||
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Listen for PART_LayoutRoot:pointerover, so it will not be triggered when subitem is pressed --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPressed}" /> |
|||
<Style Selector="^ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ TextBlock#PART_InputGestureText"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ Path#PART_ChevronPath"> |
|||
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ TextBlock#PART_InputGestureText"> |
|||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Path#PART_ChevronPath"> |
|||
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:open /template/ Path#PART_ChevronPath"> |
|||
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronSubMenuOpened}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:empty /template/ Path#PART_ChevronPath"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:separator"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Separator/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Image#PART_ToggleIconImage"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked:toggle /template/ ContentControl#PART_ToggleIconPresenter"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="Content"> |
|||
<Template> |
|||
<Path Fill="{Binding $parent[MenuItem].Foreground}" |
|||
Width="16" |
|||
Data="{StaticResource CheckMarkPathData}" /> |
|||
</Template> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:checked:radio /template/ ContentControl#PART_ToggleIconPresenter"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="Content"> |
|||
<Template> |
|||
<Ellipse Fill="{Binding $parent[MenuItem].Foreground}" |
|||
Margin="4" Width="8" Height="8" /> |
|||
</Template> |
|||
</Setter> |
|||
</Style> |
|||
</ControlTheme> |
|||
<ControlTheme x:Key="HorizontalMenuItem" TargetType="MenuItem" BasedOn="{StaticResource FluentTopLevelMenuItem}"> |
|||
<Setter Property="Padding" Value="{DynamicResource HorizontalMenuFlyoutItemThemePaddingNarrow}" /> |
|||
<Setter Property="Margin" Value="{DynamicResource HorizontalMenuFlyoutItemMargin}" /> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentMenuItemIconTheme" |
|||
TargetType="ContentControl"> |
|||
<Setter Property="Width" |
|||
Value="16" /> |
|||
<Setter Property="Height" |
|||
Value="16" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Viewbox |
|||
StretchDirection="DownOnly" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" Content="{TemplateBinding Content}" /> |
|||
</Viewbox> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,93 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<Design.PreviewWith> |
|||
<ScrollViewer Theme="{DynamicResource FluentMenuScrollViewer}" Width="200" Height="200"> |
|||
<StackPanel Spacing="20"> |
|||
<TextBlock>Item 1</TextBlock> |
|||
<TextBlock>Item 2</TextBlock> |
|||
<TextBlock>Item 3</TextBlock> |
|||
<TextBlock>Item 4</TextBlock> |
|||
<TextBlock>Item 5</TextBlock> |
|||
<TextBlock>Item 6</TextBlock> |
|||
<TextBlock>Item 7</TextBlock> |
|||
<TextBlock>Item 8</TextBlock> |
|||
<TextBlock>Item 9</TextBlock> |
|||
</StackPanel> |
|||
</ScrollViewer> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="FluentMenuScrollViewer" TargetType="ScrollViewer"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="IsScrollChainingEnabled" Value="False" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel> |
|||
<RepeatButton DockPanel.Dock="Top" |
|||
BorderThickness="0" |
|||
Background="Transparent" |
|||
HorizontalAlignment="Stretch" |
|||
HorizontalContentAlignment="Center" |
|||
RenderTransform="{x:Null}" |
|||
Command="{Binding LineUp, RelativeSource={RelativeSource TemplatedParent}}"> |
|||
<RepeatButton.IsVisible> |
|||
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" |
|||
ConverterParameter="0"> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalScrollBarVisibility" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Offset.Y" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Extent.Height" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Viewport.Height" /> |
|||
</MultiBinding> |
|||
</RepeatButton.IsVisible> |
|||
<Viewbox Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"> |
|||
<Path VerticalAlignment="Center" |
|||
HorizontalAlignment="Center" |
|||
Data="M 19.091797 14.970703 L 10 5.888672 L 0.908203 14.970703 L 0.029297 14.091797 L 10 4.111328 L 19.970703 14.091797 Z" |
|||
Fill="{DynamicResource ScrollBarButtonArrowForeground}" |
|||
Width="20" |
|||
Height="20" /> |
|||
</Viewbox> |
|||
</RepeatButton> |
|||
<RepeatButton DockPanel.Dock="Bottom" |
|||
BorderThickness="0" |
|||
Background="Transparent" |
|||
HorizontalAlignment="Stretch" |
|||
HorizontalContentAlignment="Center" |
|||
RenderTransform="{x:Null}" |
|||
Command="{Binding LineDown, RelativeSource={RelativeSource TemplatedParent}}"> |
|||
<RepeatButton.IsVisible> |
|||
<MultiBinding Converter="{x:Static converters:MenuScrollingVisibilityConverter.Instance}" |
|||
ConverterParameter="100"> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="VerticalScrollBarVisibility" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Offset.Y" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Extent.Height" /> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Viewport.Height" /> |
|||
</MultiBinding> |
|||
</RepeatButton.IsVisible> |
|||
<Viewbox Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"> |
|||
<Path VerticalAlignment="Center" |
|||
HorizontalAlignment="Center" |
|||
Data="M 18.935547 4.560547 L 19.814453 5.439453 L 10 15.253906 L 0.185547 5.439453 L 1.064453 4.560547 L 10 13.496094 Z" |
|||
Fill="{DynamicResource ScrollBarButtonArrowForeground}" |
|||
Width="20" |
|||
Height="20" /> |
|||
</Viewbox> |
|||
</RepeatButton> |
|||
<ScrollContentPresenter Name="PART_ContentPresenter"> |
|||
<ScrollContentPresenter.GestureRecognizers> |
|||
<ScrollGestureRecognizer CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}" |
|||
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}" /> |
|||
</ScrollContentPresenter.GestureRecognizers> |
|||
</ScrollContentPresenter> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^ /template/ RepeatButton:pointerover > Viewbox > Path"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,222 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Width="400" Height="600"> |
|||
<NavigationPage /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<StreamGeometry x:Key="NavigationPageMenuIcon">M3 17h18a1 1 0 0 1 .117 1.993L21 19H3a1 1 0 0 1-.117-1.993L3 17h18H3Zm0-6 18-.002a1 1 0 0 1 .117 1.993l-.117.007L3 13a1 1 0 0 1-.117-1.993L3 11l18-.002L3 11Zm0-6h18a1 1 0 0 1 .117 1.993L21 7H3a1 1 0 0 1-.117-1.993L3 5h18H3Z</StreamGeometry> |
|||
|
|||
<StreamGeometry x:Key="NavigationPageBackIcon">M12.7347,4.20949 C13.0332,3.92233 13.508,3.93153 13.7952,4.23005 C14.0823,4.52857 14.0731,5.00335 13.7746,5.29051 L5.50039,13.25 L24.2532,13.25 C24.6674,13.25 25.0032,13.5858 25.0032,13.9999982 C25.0032,14.4142 24.6674,14.75 24.2532,14.75 L5.50137,14.75 L13.7746,22.7085 C14.0731,22.9957 14.0823,23.4705 13.7952,23.769 C13.508,24.0675 13.0332,24.0767 12.7347,23.7896 L3.30673,14.7202 C2.89776,14.3268 2.89776,13.6723 3.30673,13.2788 L12.7347,4.20949 Z</StreamGeometry> |
|||
|
|||
<SolidColorBrush x:Key="NavigationBarBackground" Color="{DynamicResource SystemChromeMediumColor}" /> |
|||
<SolidColorBrush x:Key="NavigationBarForeground" Color="{DynamicResource SystemBaseMediumColor}" /> |
|||
|
|||
<ControlTheme x:Key="{x:Type NavigationPage}" TargetType="NavigationPage"> |
|||
<!-- Transparent keeps the hit-test surface active for the back-swipe gesture edge area. --> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="PageTransition"> |
|||
<Setter.Value> |
|||
<PageSlide Duration="0:0:0.3" Orientation="Horizontal" FillMode="Forward"> |
|||
<PageSlide.SlideInEasing> |
|||
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" /> |
|||
</PageSlide.SlideInEasing> |
|||
<PageSlide.SlideOutEasing> |
|||
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" /> |
|||
</PageSlide.SlideOutEasing> |
|||
</PageSlide> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="ModalTransition"> |
|||
<Setter.Value> |
|||
<PageSlide Duration="0:0:0.25" Orientation="Vertical" FillMode="Forward"> |
|||
<PageSlide.SlideInEasing> |
|||
<SplineEasing X1="0.16" Y1="1" X2="0.3" Y2="1" /> |
|||
</PageSlide.SlideInEasing> |
|||
<PageSlide.SlideOutEasing> |
|||
<SplineEasing X1="0.2" Y1="0.85" X2="0.3" Y2="1" /> |
|||
</PageSlide.SlideOutEasing> |
|||
</PageSlide> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<!-- ClipToBounds prevents slide animations bleeding outside the control bounds. --> |
|||
<Panel ClipToBounds="True"> |
|||
<DockPanel> |
|||
<!-- Reserves nav-bar height in Inset mode. Invisible in Overlay mode. --> |
|||
<Border Name="PART_NavBarSpacer" |
|||
Height="{TemplateBinding EffectiveBarHeight}" |
|||
IsVisible="False" |
|||
DockPanel.Dock="Top" /> |
|||
|
|||
<ContentPresenter Name="PART_BottomCommandBar" |
|||
DockPanel.Dock="Bottom" |
|||
HorizontalContentAlignment="Stretch" |
|||
Background="{TemplateBinding Background}" |
|||
Content="{Binding CurrentPage?.(NavigationPage.BottomCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" /> |
|||
|
|||
<!-- Back and front presenters enable slide transitions without Control recycling. --> |
|||
<Grid Name="PART_ContentHost" |
|||
Background="{TemplateBinding Background}" |
|||
ClipToBounds="True"> |
|||
<ContentPresenter Name="PART_PageBackPresenter" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" /> |
|||
<ContentPresenter Name="PART_PagePresenter" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" /> |
|||
</Grid> |
|||
</DockPanel> |
|||
|
|||
<!-- Navigation bar floats above content (ZIndex=1). --> |
|||
<Border Name="PART_NavigationBar" |
|||
ZIndex="1" |
|||
VerticalAlignment="Top" |
|||
ClipToBounds="True" |
|||
Height="{TemplateBinding EffectiveBarHeight}"> |
|||
<Grid Margin="12,0,0,0" ColumnDefinitions="Auto, *, Auto"> |
|||
<Grid.Styles> |
|||
<Style Selector="Button#PART_BackButton /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="CornerRadius" Value="4" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_BackButton:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_BackButton:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_BackButton:disabled"> |
|||
<Setter Property="Opacity" Value="0.4" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_BackButton:focus-visible /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="BorderThickness" Value="2" /> |
|||
<Setter Property="CornerRadius" Value="4" /> |
|||
</Style> |
|||
<Style Selector="Button:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_OverflowButton /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="CornerRadius" Value="0" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_OverflowButton:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_OverflowButton:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
</Style> |
|||
</Grid.Styles> |
|||
|
|||
<Button x:Name="PART_BackButton" |
|||
Grid.Column="0" |
|||
Background="Transparent" |
|||
Foreground="{DynamicResource NavigationBarForeground}" |
|||
IsVisible="{TemplateBinding IsBackButtonEffectivelyVisible}" |
|||
VerticalAlignment="Stretch" |
|||
Padding="8,0" |
|||
ToolTip.Tip="{x:Null}"> |
|||
<Panel Background="Transparent"> |
|||
<Path Data="{DynamicResource NavigationPageBackIcon}" |
|||
x:Name="PART_BackButtonDefaultIcon" |
|||
Fill="{DynamicResource NavigationBarForeground}" |
|||
Width="24" |
|||
Height="24" |
|||
Stretch="Uniform" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" /> |
|||
<ContentPresenter |
|||
x:Name="PART_BackButtonContentPresenter" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Center"/> |
|||
</Panel> |
|||
</Button> |
|||
|
|||
<ContentPresenter Name="PART_Header" |
|||
Grid.Column="1" |
|||
FontSize="20" |
|||
Foreground="{DynamicResource NavigationBarForeground}" |
|||
Content="{Binding CurrentPage?.Header, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" |
|||
ContentTemplate="{Binding CurrentPage?.HeaderTemplate, RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Stretch" |
|||
HorizontalContentAlignment="Stretch" |
|||
Margin="0,0,12,0" /> |
|||
|
|||
<ContentPresenter Name="PART_TopCommandBar" |
|||
Grid.Column="2" |
|||
HorizontalAlignment="Right" |
|||
VerticalContentAlignment="Stretch" |
|||
Foreground="{DynamicResource NavigationBarForeground}" |
|||
Content="{Binding CurrentPage?.(NavigationPage.TopCommandBar), RelativeSource={RelativeSource TemplatedParent}, FallbackValue={x:Null}}"> |
|||
<ContentPresenter.Styles> |
|||
<Style Selector="CommandBar"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
</Style> |
|||
<Style Selector="CommandBarButton"> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="Padding" Value="8,0" /> |
|||
</Style> |
|||
<Style Selector="CommandBarToggleButton"> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="Padding" Value="8,0" /> |
|||
</Style> |
|||
<Style Selector="Button#PART_OverflowButton"> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="Padding" Value="8,0" /> |
|||
</Style> |
|||
</ContentPresenter.Styles> |
|||
</ContentPresenter> |
|||
</Grid> |
|||
</Border> |
|||
|
|||
<!-- Nav-bar shadow gradient. Margin.Top is set from code to match EffectiveBarHeight. --> |
|||
<Border Name="PART_NavBarShadow" |
|||
ZIndex="1" |
|||
VerticalAlignment="Top" |
|||
IsVisible="False" |
|||
Height="4" |
|||
IsHitTestVisible="False"> |
|||
<Border.Background> |
|||
<LinearGradientBrush StartPoint="0%,0%" EndPoint="0%,100%"> |
|||
<GradientStop Color="#0C000000" Offset="0" /> |
|||
<GradientStop Color="#00000000" Offset="1" /> |
|||
</LinearGradientBrush> |
|||
</Border.Background> |
|||
</Border> |
|||
|
|||
<!-- Modal overlay: ZIndex=99 holds the static layer during transitions; ZIndex=100 is the animating modal. --> |
|||
<ContentPresenter Name="PART_ModalBackPresenter" |
|||
ZIndex="99" |
|||
IsVisible="False" |
|||
Background="{TemplateBinding Background}" /> |
|||
<ContentPresenter Name="PART_ModalPresenter" |
|||
ZIndex="100" |
|||
IsVisible="False" |
|||
Background="{TemplateBinding Background}" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Default nav bar background, overridable via a more-specific style selector --> |
|||
<Style Selector="^ /template/ Border#PART_NavigationBar"> |
|||
<Setter Property="Background" Value="{DynamicResource NavigationBarBackground}" /> |
|||
</Style> |
|||
|
|||
<!-- :nav-bar-inset: spacer reserves nav-bar height so content is pushed below --> |
|||
<Style Selector="^:nav-bar-inset /template/ Border#PART_NavBarSpacer"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- :nav-bar-compact: collapse CommandBar labels when bar is too short --> |
|||
<Style Selector="^:nav-bar-compact /template/ ContentPresenter#PART_TopCommandBar CommandBar"> |
|||
<Setter Property="DefaultLabelPosition" Value="Collapsed" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,99 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="0" Background="White"> |
|||
<NotificationCard Content="Testing" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<ControlTheme x:Key="{x:Type NotificationCard}" TargetType="NotificationCard"> |
|||
<Setter Property="UseLayoutRounding" Value="True"/> |
|||
<Setter Property="Width" Value="350"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource NotificationCardForegroundBrush}"/> |
|||
<Setter Property="RenderTransformOrigin" Value="50%,75%"/> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Background" Value="{DynamicResource NotificationCardBackgroundBrush}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl Name="PART_LayoutTransformControl" UseRenderTransform="True"> |
|||
<Border CornerRadius="{TemplateBinding CornerRadius}" BoxShadow="0 6 8 0 #4F000000" Margin="5 5 5 10"> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ClipToBounds="True"> |
|||
<DockPanel> |
|||
<Panel x:Name="PART_HeaderBar" Height="4" Background="{DynamicResource NotificationCardProgressBackgroundBrush}" DockPanel.Dock="Top" /> |
|||
<ContentPresenter Name="PART_ContentPresenter" MinHeight="64" Content="{TemplateBinding Content}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
</Border> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<ControlTheme.Animations> |
|||
<Animation Duration="0:0:0.45" Easing="QuadraticEaseIn" FillMode="Forward"> |
|||
<KeyFrame Cue="0%"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
<Setter Property="TranslateTransform.Y" Value="20"/> |
|||
<Setter Property="ScaleTransform.ScaleX" Value="0.85"/> |
|||
<Setter Property="ScaleTransform.ScaleY" Value="0.85"/> |
|||
</KeyFrame> |
|||
<KeyFrame Cue="30%"> |
|||
<Setter Property="TranslateTransform.Y" Value="-20"/> |
|||
</KeyFrame> |
|||
<KeyFrame Cue="100%"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
<Setter Property="TranslateTransform.Y" Value="0"/> |
|||
<Setter Property="ScaleTransform.ScaleX" Value="1"/> |
|||
<Setter Property="ScaleTransform.ScaleY" Value="1"/> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</ControlTheme.Animations> |
|||
|
|||
<Style Selector="^[IsClosing=true] /template/ LayoutTransformControl#PART_LayoutTransformControl"> |
|||
<Setter Property="RenderTransformOrigin" Value="50%,0%"/> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:0.75" Easing="QuadraticEaseOut" FillMode="Forward"> |
|||
<KeyFrame Cue="0%"> |
|||
<Setter Property="TranslateTransform.X" Value="0"/> |
|||
<Setter Property="ScaleTransform.ScaleY" Value="1"/> |
|||
</KeyFrame> |
|||
<KeyFrame Cue="70%"> |
|||
<Setter Property="TranslateTransform.X" Value="800"/> |
|||
<Setter Property="ScaleTransform.ScaleY" Value="1"/> |
|||
</KeyFrame> |
|||
<KeyFrame Cue="100%"> |
|||
<Setter Property="ScaleTransform.ScaleY" Value="0"/> |
|||
<Setter Property="TranslateTransform.X" Value="800"/> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
|
|||
<Style Selector="^[IsClosing=true]"> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:1.25" Easing="QuadraticEaseOut" FillMode="Forward"> |
|||
<KeyFrame Cue="100%"> |
|||
<Setter Property="IsClosed" Value="True"/> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
|
|||
<Style Selector="^:information /template/ Panel#PART_HeaderBar"> |
|||
<Setter Property="Background" Value="{DynamicResource NotificationCardInformationBackgroundBrush}"/> |
|||
</Style> |
|||
<Style Selector="^:success /template/ Panel#PART_HeaderBar"> |
|||
<Setter Property="Background" Value="{DynamicResource NotificationCardSuccessBackgroundBrush}"/> |
|||
</Style> |
|||
<Style Selector="^:warning /template/ Panel#PART_HeaderBar"> |
|||
<Setter Property="Background" Value="{DynamicResource NotificationCardWarningBackgroundBrush}"/> |
|||
</Style> |
|||
<Style Selector="^:error /template/ Panel#PART_HeaderBar"> |
|||
<Setter Property="Background" Value="{DynamicResource NotificationCardErrorBackgroundBrush}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,101 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=System.Runtime" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
PlaceholderText="Enter text" /> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
VerticalContentAlignment="Center" |
|||
HorizontalContentAlignment="Center" |
|||
ButtonSpinnerLocation="Left" |
|||
PlaceholderText="Enter text" /> |
|||
<NumericUpDown ButtonSpinnerLocation="Left"> |
|||
<NumericUpDown.InnerLeftContent> |
|||
<TextBlock Text="m" |
|||
TextAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
</NumericUpDown.InnerLeftContent> |
|||
<NumericUpDown.InnerRightContent> |
|||
<Button Content="X"/> |
|||
</NumericUpDown.InnerRightContent> |
|||
</NumericUpDown> |
|||
<NumericUpDown ButtonSpinnerLocation="Right"> |
|||
<NumericUpDown.InnerLeftContent> |
|||
<Button Content="X"/> |
|||
</NumericUpDown.InnerLeftContent> |
|||
<NumericUpDown.InnerRightContent> |
|||
<TextBlock Text="m" |
|||
TextAlignment="Center" |
|||
VerticalAlignment="Center"/> |
|||
</NumericUpDown.InnerRightContent> |
|||
</NumericUpDown> |
|||
<NumericUpDown> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</NumericUpDown> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<ButtonSpinner Name="PART_Spinner" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsTabStop="False" |
|||
Padding="0" |
|||
MinWidth="0" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
AllowSpin="{TemplateBinding AllowSpin}" |
|||
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" |
|||
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> |
|||
<TextBox Name="PART_TextBox" |
|||
Background="Transparent" |
|||
BorderBrush="Transparent" |
|||
Margin="-1" |
|||
Padding="{TemplateBinding Padding}" |
|||
MinWidth="0" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
PlaceholderText="{TemplateBinding PlaceholderText}" |
|||
PlaceholderForeground="{TemplateBinding PlaceholderForeground}" |
|||
IsReadOnly="{TemplateBinding IsReadOnly}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Text="{TemplateBinding Text}" |
|||
TextAlignment="{TemplateBinding TextAlignment}" |
|||
AcceptsReturn="False" |
|||
TextWrapping="NoWrap" |
|||
InnerLeftContent="{Binding InnerLeftContent, RelativeSource={RelativeSource TemplatedParent}}" |
|||
InnerRightContent="{Binding InnerRightContent, RelativeSource={RelativeSource TemplatedParent}}"/> |
|||
</ButtonSpinner> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,25 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type OverlayPopupHost}" TargetType="OverlayPopupHost"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="FontWeight" Value="Normal" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Inline.TextDecorations" Value="" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<VisualLayerManager Name="PART_VisualLayerManager"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,26 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<StackPanel> |
|||
<StackPanel.Resources> |
|||
<StreamGeometry x:Key="settings_regular">M14 9.50006C11.5147 9.50006 9.5 11.5148 9.5 14.0001C9.5 16.4853 11.5147 18.5001 14 18.5001C15.3488 18.5001 16.559 17.9066 17.3838 16.9666C18.0787 16.1746 18.5 15.1365 18.5 14.0001C18.5 13.5401 18.431 13.0963 18.3028 12.6784C17.7382 10.8381 16.0253 9.50006 14 9.50006ZM11 14.0001C11 12.3432 12.3431 11.0001 14 11.0001C15.6569 11.0001 17 12.3432 17 14.0001C17 15.6569 15.6569 17.0001 14 17.0001C12.3431 17.0001 11 15.6569 11 14.0001Z M21.7093 22.3948L19.9818 21.6364C19.4876 21.4197 18.9071 21.4515 18.44 21.7219C17.9729 21.9924 17.675 22.4693 17.6157 23.0066L17.408 24.8855C17.3651 25.273 17.084 25.5917 16.7055 25.682C14.9263 26.1061 13.0725 26.1061 11.2933 25.682C10.9148 25.5917 10.6336 25.273 10.5908 24.8855L10.3834 23.0093C10.3225 22.4731 10.0112 21.9976 9.54452 21.7281C9.07783 21.4586 8.51117 21.4269 8.01859 21.6424L6.29071 22.4009C5.93281 22.558 5.51493 22.4718 5.24806 22.1859C4.00474 20.8536 3.07924 19.2561 2.54122 17.5137C2.42533 17.1384 2.55922 16.7307 2.8749 16.4977L4.40219 15.3703C4.83721 15.0501 5.09414 14.5415 5.09414 14.0007C5.09414 13.4598 4.83721 12.9512 4.40162 12.6306L2.87529 11.5051C2.55914 11.272 2.42513 10.8638 2.54142 10.4882C3.08038 8.74734 4.00637 7.15163 5.24971 5.82114C5.51684 5.53528 5.93492 5.44941 6.29276 5.60691L8.01296 6.36404C8.50793 6.58168 9.07696 6.54881 9.54617 6.27415C10.0133 6.00264 10.3244 5.52527 10.3844 4.98794L10.5933 3.11017C10.637 2.71803 10.9245 2.39704 11.3089 2.31138C12.19 2.11504 13.0891 2.01071 14.0131 2.00006C14.9147 2.01047 15.8128 2.11485 16.6928 2.31149C17.077 2.39734 17.3643 2.71823 17.4079 3.11017L17.617 4.98937C17.7116 5.85221 18.4387 6.50572 19.3055 6.50663C19.5385 6.507 19.769 6.45838 19.9843 6.36294L21.7048 5.60568C22.0626 5.44818 22.4807 5.53405 22.7478 5.81991C23.9912 7.1504 24.9172 8.74611 25.4561 10.487C25.5723 10.8623 25.4386 11.2703 25.1228 11.5035L23.5978 12.6297C23.1628 12.95 22.9 13.4586 22.9 13.9994C22.9 14.5403 23.1628 15.0489 23.5988 15.3698L25.1251 16.4965C25.441 16.7296 25.5748 17.1376 25.4586 17.5131C24.9198 19.2536 23.9944 20.8492 22.7517 22.1799C22.4849 22.4657 22.0671 22.5518 21.7093 22.3948ZM16.263 22.1966C16.4982 21.4685 16.9889 20.8288 17.6884 20.4238C18.5702 19.9132 19.6536 19.8547 20.5841 20.2627L21.9281 20.8526C22.791 19.8538 23.4593 18.7013 23.8981 17.4552L22.7095 16.5778L22.7086 16.5771C21.898 15.98 21.4 15.0277 21.4 13.9994C21.4 12.9719 21.8974 12.0195 22.7073 11.4227L22.7085 11.4218L23.8957 10.545C23.4567 9.2988 22.7881 8.14636 21.9248 7.1477L20.5922 7.73425L20.5899 7.73527C20.1844 7.91463 19.7472 8.00722 19.3039 8.00663C17.6715 8.00453 16.3046 6.77431 16.1261 5.15465L16.1259 5.15291L15.9635 3.69304C15.3202 3.57328 14.6677 3.50872 14.013 3.50017C13.3389 3.50891 12.6821 3.57367 12.0377 3.69328L11.8751 5.15452C11.7625 6.16272 11.1793 7.05909 10.3019 7.56986C9.41937 8.0856 8.34453 8.14844 7.40869 7.73694L6.07273 7.14893C5.20949 8.14751 4.54092 9.29983 4.10196 10.5459L5.29181 11.4233C6.11115 12.0269 6.59414 12.9837 6.59414 14.0007C6.59414 15.0173 6.11142 15.9742 5.29237 16.5776L4.10161 17.4566C4.54002 18.7044 5.2085 19.8585 6.07205 20.8587L7.41742 20.2682C8.34745 19.8613 9.41573 19.9215 10.2947 20.4292C11.174 20.937 11.7593 21.832 11.8738 22.84L11.8744 22.8445L12.0362 24.3088C13.3326 24.5638 14.6662 24.5638 15.9626 24.3088L16.1247 22.8418C16.1491 22.6217 16.1955 22.4055 16.263 22.1966Z</StreamGeometry> |
|||
</StackPanel.Resources> |
|||
<PathIcon Data="{StaticResource settings_regular}" /> |
|||
</StackPanel> |
|||
</Design.PreviewWith> |
|||
<ControlTheme x:Key="{x:Type PathIcon}" TargetType="PathIcon"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" /> |
|||
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}"> |
|||
<Viewbox Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"> |
|||
<Path Fill="{TemplateBinding Foreground}" Data="{TemplateBinding Data}" Stretch="Uniform" /> |
|||
</Viewbox> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,351 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<PipsPager NumberOfPages="5" SelectedPageIndex="2" /> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- Icon path data for navigation buttons --> |
|||
<!-- Horizontal (left/right arrows) --> |
|||
<StreamGeometry x:Key="PipsPagerPreviousPageButtonData">M 8.12,2.29 L 3.41,7.00 C 3.14,7.27 3.14,7.71 3.41,7.98 L 8.12,12.69 C 8.57,13.14 9.33,12.82 9.33,12.19 L 9.33,2.79 C 9.33,2.16 8.57,1.84 8.12,2.29 Z</StreamGeometry> |
|||
<StreamGeometry x:Key="PipsPagerNextPageButtonData">M 3.88,2.29 L 8.59,7.00 C 8.86,7.27 8.86,7.71 8.59,7.98 L 3.88,12.69 C 3.43,13.14 2.67,12.82 2.67,12.19 L 2.67,2.79 C 2.67,2.16 3.43,1.84 3.88,2.29 Z</StreamGeometry> |
|||
|
|||
<!-- Vertical (up/down arrows) --> |
|||
<StreamGeometry x:Key="PipsPagerPreviousPageButtonVerticalData">M 2.29,8.12 L 7.00,3.41 C 7.27,3.14 7.71,3.14 7.98,3.41 L 12.69,8.12 C 13.14,8.57 12.82,9.33 12.19,9.33 L 2.79,9.33 C 2.16,9.33 1.84,8.57 2.29,8.12 Z</StreamGeometry> |
|||
<StreamGeometry x:Key="PipsPagerNextPageButtonVerticalData">M 2.29,3.88 L 7.00,8.59 C 7.27,8.86 7.71,8.86 7.98,8.59 L 12.69,3.88 C 13.14,3.43 12.82,2.67 12.19,2.67 L 2.79,2.67 C 2.16,2.67 1.84,3.43 2.29,3.88 Z</StreamGeometry> |
|||
|
|||
<!-- Base navigation button theme (for custom button themes to inherit from) --> |
|||
<ControlTheme x:Key="PipsPagerNavigationButtonTheme" TargetType="Button"> |
|||
<Setter Property="Background" Value="{DynamicResource PipsPagerNavigationButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerNavigationButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource PipsPagerNavigationButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="1" /> |
|||
<Setter Property="Width" Value="24" /> |
|||
<Setter Property="Height" Value="24" /> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource PipsPagerNavigationButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource PipsPagerNavigationButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerNavigationButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource PipsPagerNavigationButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource PipsPagerNavigationButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerNavigationButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource PipsPagerNavigationButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource PipsPagerNavigationButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource PipsPagerNavigationButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- Previous button theme --> |
|||
<ControlTheme x:Key="PipsPagerPreviousButtonTheme" TargetType="Button" BasedOn="{StaticResource PipsPagerNavigationButtonTheme}" /> |
|||
|
|||
<!-- Next button theme --> |
|||
<ControlTheme x:Key="PipsPagerNextButtonTheme" TargetType="Button" BasedOn="{StaticResource PipsPagerNavigationButtonTheme}" /> |
|||
|
|||
<ControlTheme x:Key="PipsPagerItemTheme" TargetType="ListBoxItem"> |
|||
<Setter Property="Width" Value="12" /> |
|||
<Setter Property="Height" Value="24" /> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="MinWidth" Value="0" /> |
|||
<Setter Property="MinHeight" Value="0" /> |
|||
<Setter Property="ClipToBounds" Value="False" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Background="Transparent"> |
|||
<Ellipse Name="PipBackground" |
|||
Width="10" |
|||
Height="10" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Fill="{DynamicResource PipsPagerSelectionIndicatorBackground}" |
|||
Stroke="{DynamicResource PipsPagerSelectionIndicatorBorderBrush}" |
|||
StrokeThickness="1"> |
|||
<Ellipse.Transitions> |
|||
<Transitions> |
|||
<BrushTransition Property="Fill" Duration="0:0:0.167" /> |
|||
<BrushTransition Property="Stroke" Duration="0:0:0.167" /> |
|||
</Transitions> |
|||
</Ellipse.Transitions> |
|||
</Ellipse> |
|||
<Ellipse Name="Pip" |
|||
Width="4" |
|||
Height="4" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Fill="{DynamicResource PipsPagerSelectionIndicatorForeground}"> |
|||
<Ellipse.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Width" Duration="0:0:0.167" /> |
|||
<DoubleTransition Property="Height" Duration="0:0:0.167" /> |
|||
<BrushTransition Property="Fill" Duration="0:0:0.167" /> |
|||
</Transitions> |
|||
</Ellipse.Transitions> |
|||
</Ellipse> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#Pip"> |
|||
<Setter Property="Width" Value="6" /> |
|||
<Setter Property="Height" Value="6" /> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover /template/ Ellipse#PipBackground"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorBackgroundPointerOver}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource PipsPagerSelectionIndicatorBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Ellipse#Pip"> |
|||
<Setter Property="Width" Value="4" /> |
|||
<Setter Property="Height" Value="4" /> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorForegroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Ellipse#PipBackground"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorBackgroundPressed}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource PipsPagerSelectionIndicatorBorderBrushPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:selected /template/ Ellipse#Pip"> |
|||
<Setter Property="Width" Value="6" /> |
|||
<Setter Property="Height" Value="6" /> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Ellipse#PipBackground"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorBackgroundSelected}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource PipsPagerSelectionIndicatorBorderBrushSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected:pointerover /template/ Ellipse#Pip"> |
|||
<Setter Property="Width" Value="6" /> |
|||
<Setter Property="Height" Value="6" /> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:selected:pointerover /template/ Ellipse#PipBackground"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorBackgroundPointerOver}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource PipsPagerSelectionIndicatorBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ Ellipse#Pip"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ Ellipse#PipBackground"> |
|||
<Setter Property="Fill" Value="{DynamicResource PipsPagerSelectionIndicatorBackgroundDisabled}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource PipsPagerSelectionIndicatorBorderBrushDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type PipsPager}" TargetType="PipsPager"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="IsTabStop" Value="False" /> |
|||
<Setter Property="PreviousButtonTheme" Value="{StaticResource PipsPagerPreviousButtonTheme}" /> |
|||
<Setter Property="NextButtonTheme" Value="{StaticResource PipsPagerNextButtonTheme}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel Name="PART_RootPanel" |
|||
Orientation="{TemplateBinding Orientation}" |
|||
Background="{TemplateBinding Background}" |
|||
ClipToBounds="False"> |
|||
<Button Name="PART_PreviousButton" |
|||
Theme="{TemplateBinding PreviousButtonTheme}" |
|||
IsVisible="{TemplateBinding IsPreviousButtonVisible}" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Center"> |
|||
<PathIcon Name="PreviousButtonIcon" Width="10" Height="10" |
|||
Data="{StaticResource PipsPagerPreviousPageButtonData}" /> |
|||
</Button> |
|||
|
|||
<ListBox Name="PART_PipsPagerList" |
|||
Background="Transparent" |
|||
BorderThickness="0" |
|||
Padding="0" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
ScrollViewer.HorizontalScrollBarVisibility="Hidden" |
|||
ScrollViewer.VerticalScrollBarVisibility="Hidden" |
|||
ItemsSource="{Binding TemplateSettings.Pips, RelativeSource={RelativeSource TemplatedParent}}" |
|||
SelectedIndex="{Binding SelectedPageIndex, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" |
|||
AutoScrollToSelectedItem="False" |
|||
ClipToBounds="False" |
|||
ItemContainerTheme="{StaticResource PipsPagerItemTheme}"> |
|||
<ListBox.Styles> |
|||
<Style Selector="ScrollViewer"> |
|||
<Setter Property="ClipToBounds" Value="False" /> |
|||
</Style> |
|||
</ListBox.Styles> |
|||
<ListBox.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<StackPanel Orientation="{Binding Orientation, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=PipsPager}}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
Spacing="0" /> |
|||
</ItemsPanelTemplate> |
|||
</ListBox.ItemsPanel> |
|||
</ListBox> |
|||
|
|||
<Button Name="PART_NextButton" |
|||
Theme="{TemplateBinding NextButtonTheme}" |
|||
IsVisible="{TemplateBinding IsNextButtonVisible}" |
|||
VerticalAlignment="Center" |
|||
HorizontalAlignment="Center"> |
|||
<PathIcon Name="NextButtonIcon" Width="10" Height="10" |
|||
Data="{StaticResource PipsPagerNextPageButtonData}" /> |
|||
</Button> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:horizontal /template/ StackPanel#PART_RootPanel"> |
|||
<Setter Property="Orientation" Value="Horizontal" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:vertical /template/ ListBox ListBoxItem"> |
|||
<Setter Property="Width" Value="24" /> |
|||
<Setter Property="Height" Value="12" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:vertical /template/ StackPanel#PART_RootPanel"> |
|||
<Setter Property="Orientation" Value="Vertical" /> |
|||
<Setter Property="HorizontalAlignment" Value="Center" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:vertical /template/ Button#PART_PreviousButton PathIcon#PreviousButtonIcon"> |
|||
<Setter Property="Data" Value="{StaticResource PipsPagerPreviousPageButtonVerticalData}" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Button#PART_NextButton PathIcon#NextButtonIcon"> |
|||
<Setter Property="Data" Value="{StaticResource PipsPagerNextPageButtonVerticalData}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:first-page /template/ Button#PART_PreviousButton"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="IsHitTestVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:last-page /template/ Button#PART_NextButton"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="IsHitTestVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Button#PART_PreviousButton:pressed"> |
|||
<Setter Property="RenderTransformOrigin" Value="0.5, 0.5" /> |
|||
<Setter Property="RenderTransform" Value="scale(0.875)" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Button#PART_NextButton:pressed"> |
|||
<Setter Property="RenderTransformOrigin" Value="0.5, 0.5" /> |
|||
<Setter Property="RenderTransform" Value="scale(0.875)" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ResourceDictionary.ThemeDictionaries> |
|||
<ResourceDictionary x:Key="Light"> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForeground" Color="#72000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPointerOver" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPressed" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundSelected" Color="#FF000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundDisabled" Color="#51000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForeground" Color="#72000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPointerOver" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPressed" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundDisabled" Color="#51000000" /> |
|||
</ResourceDictionary> |
|||
<ResourceDictionary x:Key="Default"> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForeground" Color="#72000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPointerOver" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPressed" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundSelected" Color="#FF000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundDisabled" Color="#51000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForeground" Color="#72000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPointerOver" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPressed" Color="#9E000000" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundDisabled" Color="#51000000" /> |
|||
</ResourceDictionary> |
|||
<ResourceDictionary x:Key="Dark"> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForeground" Color="#8BFFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPointerOver" Color="#C5FFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundPressed" Color="#C5FFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundSelected" Color="#FFFFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerSelectionIndicatorForegroundDisabled" Color="#3FFFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackground" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBackgroundDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrush" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonBorderBrushDisabled" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForeground" Color="#8BFFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPointerOver" Color="#C5FFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundPressed" Color="#C5FFFFFF" /> |
|||
<SolidColorBrush x:Key="PipsPagerNavigationButtonForegroundDisabled" Color="#3FFFFFFF" /> |
|||
</ResourceDictionary> |
|||
</ResourceDictionary.ThemeDictionaries> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,30 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type PopupRoot}" TargetType="PopupRoot"> |
|||
<Setter Property="Background" Value="{x:Null}" /> |
|||
<Setter Property="TransparencyLevelHint" Value="Transparent" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="FontWeight" Value="Normal" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Inline.TextDecorations" Value="" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<VisualLayerManager Name="PART_VisualLayerManager"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" /> |
|||
</VisualLayerManager> |
|||
</Panel> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,198 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Orientation="Horizontal" Spacing="10"> |
|||
<StackPanel Spacing="10"> |
|||
<ProgressBar Value="5" Maximum="10" /> |
|||
<ProgressBar Value="50" /> |
|||
<ProgressBar Value="50" Minimum="25" Maximum="75" /> |
|||
<ProgressBar IsIndeterminate="True" /> |
|||
<ProgressBar ShowProgressText="True" Value="50"/> |
|||
<ProgressBar ShowProgressText="True" |
|||
ProgressTextFormat="\{1\} percent" |
|||
Minimum="50" |
|||
Maximum="100" |
|||
Value="70"/> |
|||
</StackPanel> |
|||
<ProgressBar IsIndeterminate="True" Orientation="Vertical" /> |
|||
<ProgressBar ShowProgressText="True" Value="50" Orientation="Vertical"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<converters:StringFormatConverter x:Key="StringFormatConverter"/> |
|||
|
|||
<ControlTheme x:Key="{x:Type ProgressBar}" TargetType="ProgressBar"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAccentBrush}" /> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundBaseLowBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ProgressBarBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlHighlightTransparentBrush}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource ProgressBarThemeMinHeight}" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate TargetType="ProgressBar"> |
|||
<Border |
|||
x:Name="ProgressBarRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
ClipToBounds="True" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Panel> |
|||
<Panel x:Name="DeterminateRoot" Opacity="1"> |
|||
<Panel.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> |
|||
</Transitions> |
|||
</Panel.Transitions> |
|||
<Border |
|||
x:Name="PART_Indicator" |
|||
Margin="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Foreground}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</Panel> |
|||
<Panel x:Name="IndeterminateRoot" Opacity="0"> |
|||
<Panel.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> |
|||
</Transitions> |
|||
</Panel.Transitions> |
|||
<Border |
|||
x:Name="IndeterminateProgressBarIndicator" |
|||
Margin="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Foreground}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
<Border |
|||
x:Name="IndeterminateProgressBarIndicator2" |
|||
Margin="{TemplateBinding Padding}" |
|||
Background="{TemplateBinding Foreground}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
</Panel> |
|||
<LayoutTransformControl |
|||
x:Name="PART_LayoutTransformControl" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
IsVisible="{TemplateBinding ShowProgressText}"> |
|||
<TextBlock Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"> |
|||
<TextBlock.Text> |
|||
<MultiBinding Converter="{StaticResource StringFormatConverter}"> |
|||
<TemplateBinding Property="ProgressTextFormat"/> |
|||
<Binding Path="Value" RelativeSource="{RelativeSource TemplatedParent}"/> |
|||
<TemplateBinding Property="Percentage"/> |
|||
<TemplateBinding Property="Minimum"/> |
|||
<TemplateBinding Property="Maximum"/> |
|||
</MultiBinding> |
|||
</TextBlock.Text> |
|||
</TextBlock> |
|||
</LayoutTransformControl> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:horizontal /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
</Style> |
|||
<Style Selector="^:horizontal"> |
|||
<Setter Property="MinWidth" Value="200" /> |
|||
<Setter Property="MinHeight" Value="4" /> |
|||
</Style> |
|||
<Style Selector="^:vertical"> |
|||
<Setter Property="MinWidth" Value="4" /> |
|||
<Setter Property="MinHeight" Value="200" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl"> |
|||
<Setter Property="LayoutTransform"> |
|||
<Setter.Value> |
|||
<RotateTransform Angle="90" /> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:indeterminate /template/ Panel#DeterminateRoot"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
<Style Selector="^:indeterminate /template/ Panel#IndeterminateRoot"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Style.Animations> |
|||
<Animation IterationCount="Infinite" Duration="0:0:2"> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="^:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Style.Animations> |
|||
<Animation IterationCount="Infinite" Duration="0:0:2"> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Style.Animations> |
|||
<Animation IterationCount="Infinite" Duration="0:0:2"> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="^:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Style.Animations> |
|||
<Animation IterationCount="Infinite" Duration="0:0:2"> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2AnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateSettings.Container2Width}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,175 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="10"> |
|||
<RadioButton Content="Option 1" Background="Green" /> |
|||
<RadioButton Content="Option 2" /> |
|||
<RadioButton IsEnabled="False" Content="Option 3" /> |
|||
<RadioButton Content="Option 2" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="RadioButtonMinHeight">32</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type RadioButton}" TargetType="RadioButton"> |
|||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrush}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="8,0,0,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate TargetType="RadioButton"> |
|||
<Border |
|||
Name="RootBorder" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid ColumnDefinitions="20,*"> |
|||
<Grid Height="{DynamicResource RadioButtonMinHeight}" VerticalAlignment="Top"> |
|||
|
|||
<Ellipse |
|||
Name="OuterEllipse" |
|||
Width="20" |
|||
Height="20" |
|||
Fill="{DynamicResource RadioButtonOuterEllipseFill}" |
|||
Stroke="{DynamicResource RadioButtonOuterEllipseStroke}" |
|||
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" |
|||
UseLayoutRounding="False" /> |
|||
|
|||
<Ellipse |
|||
Name="CheckOuterEllipse" |
|||
Width="20" |
|||
Height="20" |
|||
Fill="{DynamicResource RadioButtonOuterEllipseCheckedFill}" |
|||
Opacity="0" |
|||
Stroke="{DynamicResource RadioButtonOuterEllipseCheckedStroke}" |
|||
StrokeThickness="{DynamicResource RadioButtonBorderThemeThickness}" |
|||
UseLayoutRounding="False" /> |
|||
|
|||
<Ellipse |
|||
Name="CheckGlyph" |
|||
Width="8" |
|||
Height="8" |
|||
Fill="{DynamicResource RadioButtonCheckGlyphFill}" |
|||
Opacity="0" |
|||
Stroke="{DynamicResource RadioButtonCheckGlyphStroke}" |
|||
UseLayoutRounding="False" /> |
|||
</Grid> |
|||
|
|||
<ContentPresenter |
|||
Name="PART_ContentPresenter" |
|||
Grid.Column="1" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Foreground="{TemplateBinding Foreground}" /> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#OuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePointerOver}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#CheckOuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePointerOver}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#CheckGlyph"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokePointerOver}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillPointerOver}" /> |
|||
</Style> |
|||
|
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Ellipse#OuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokePressed}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Ellipse#CheckOuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokePressed}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Ellipse#CheckGlyph"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokePressed}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillPressed}" /> |
|||
</Style> |
|||
|
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource RadioButtonForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource RadioButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RadioButtonBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Ellipse#OuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseStrokeDisabled}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseFillDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Ellipse#CheckOuterEllipse"> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonOuterEllipseCheckedStrokeDisabled}" /> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonOuterEllipseCheckedFillDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Ellipse#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource RadioButtonCheckGlyphFillDisabled}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource RadioButtonCheckGlyphStrokeDisabled}" /> |
|||
</Style> |
|||
|
|||
|
|||
<!-- Checked State --> |
|||
<Style Selector="^:checked /template/ Ellipse#CheckGlyph"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Ellipse#OuterEllipse"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Ellipse#CheckOuterEllipse"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,25 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type RefreshContainer}" |
|||
TargetType="RefreshContainer"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"> |
|||
</ContentPresenter> |
|||
<Grid Name="PART_RefreshVisualizerPresenter"/> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,31 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type RefreshVisualizer}" |
|||
TargetType="RefreshVisualizer"> |
|||
<Setter Property="IsTabStop" Value="False"/> |
|||
<Setter Property="IsHitTestVisible" Value="False"/> |
|||
<Setter Property="Height" |
|||
Value="100"/> |
|||
<Setter Property="Background" |
|||
Value="{DynamicResource RefreshVisualizerBackground}"/> |
|||
<Setter Property="Foreground" |
|||
Value="{DynamicResource RefreshVisualizerForeground}"/> |
|||
<Setter Property="Content"> |
|||
<Template> |
|||
<PathIcon Name="PART_Icon" |
|||
Data="M18.6195264,3.31842271 C19.0080059,3.31842271 19.3290603,3.60710385 19.3798716,3.9816481 L19.3868766,4.08577298 L19.3868766,6.97963208 C19.3868766,7.36811161 19.0981955,7.68916605 18.7236513,7.73997735 L18.6195264,7.74698235 L15.7256673,7.74698235 C15.3018714,7.74698235 14.958317,7.40342793 14.958317,6.97963208 C14.958317,6.59115255 15.2469981,6.27009811 15.6215424,6.21928681 L15.7256673,6.21228181 L16.7044011,6.21182461 C13.7917384,3.87107476 9.52212532,4.05209336 6.81933829,6.75488039 C3.92253872,9.65167996 3.92253872,14.34832 6.81933829,17.2451196 C9.71613786,20.1419192 14.4127779,20.1419192 17.3095775,17.2451196 C19.0725398,15.4821573 19.8106555,12.9925923 19.3476248,10.58925 C19.2674502,10.173107 19.5398064,9.77076216 19.9559494,9.69058758 C20.3720923,9.610413 20.7744372,9.88276918 20.8546118,10.2989121 C21.4129973,13.1971899 20.5217103,16.2033812 18.3947747,18.3303168 C14.8986373,21.8264542 9.23027854,21.8264542 5.73414113,18.3303168 C2.23800371,14.8341794 2.23800371,9.16582064 5.73414113,5.66968323 C9.05475132,2.34907304 14.3349409,2.18235834 17.8523166,5.16953912 L17.8521761,4.08577298 C17.8521761,3.66197713 18.1957305,3.31842271 18.6195264,3.31842271 Z" |
|||
Width="{DynamicResource RefreshVisualizerIndicatorSize}" |
|||
Height="{DynamicResource RefreshVisualizerIndicatorSize}" |
|||
/> |
|||
</Template> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="PART_Root" |
|||
MinHeight="80" |
|||
Background="{TemplateBinding Background}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,61 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<RepeatButton Content="Click Me!" /> |
|||
<RepeatButton Content="Disabled" IsEnabled="False" /> |
|||
<RepeatButton Content="Rounded" CornerRadius="16"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type RepeatButton}" TargetType="RepeatButton"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ButtonBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="{StaticResource ButtonPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,297 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Orientation="Horizontal" Spacing="20"> |
|||
<StackPanel Spacing="20"> |
|||
<ScrollBar Orientation="Horizontal" AllowAutoHide="False" VerticalAlignment="Center" Width="100"/> |
|||
<ScrollBar Orientation="Horizontal" AllowAutoHide="False" VerticalAlignment="Center" Width="100" IsEnabled="False"/> |
|||
<ScrollBar Orientation="Horizontal" AllowAutoHide="True" VerticalAlignment="Center" Width="100"/> |
|||
<ScrollBar Orientation="Horizontal" AllowAutoHide="True" VerticalAlignment="Center" Width="100" IsEnabled="False"/> |
|||
</StackPanel> |
|||
<ScrollBar Orientation="Vertical" AllowAutoHide="False" HorizontalAlignment="Center" Height="100"/> |
|||
<ScrollBar Orientation="Vertical" AllowAutoHide="False" HorizontalAlignment="Center" Height="100" IsEnabled="False"/> |
|||
<ScrollBar Orientation="Vertical" AllowAutoHide="True" HorizontalAlignment="Center" Height="100"/> |
|||
<ScrollBar Orientation="Vertical" AllowAutoHide="True" HorizontalAlignment="Center" Height="100" IsEnabled="False"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="FluentScrollBarThumb" TargetType="Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarPanningThumbBackground}"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"/> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<CornerRadiusTransition Property="CornerRadius" Duration="0:0:0.1" /> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbFillPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Border"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbFillPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ Border"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbFillDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentScrollBarPageButton" TargetType="RepeatButton"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentScrollBarLineButton" TargetType="RepeatButton"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ScrollBarButtonArrowForeground}"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{DynamicResource ScrollBarButtonBackground}" |
|||
BorderBrush="{DynamicResource ScrollBarButtonBorderBrush}" |
|||
Content="{TemplateBinding Content}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}"/> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter" > |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ScrollBarButtonBorderBrushPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ScrollBarButtonArrowForegroundPressed}"/> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter" > |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ScrollBarButtonBorderBrushPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ScrollBarButtonArrowForegroundDisabled}"/> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter" > |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ScrollBarButtonBorderBrushDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type ScrollBar}" TargetType="ScrollBar"> |
|||
<Setter Property="MinWidth" Value="{DynamicResource ScrollBarSize}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource ScrollBarSize}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ScrollBarForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ScrollBarBorderBrush}" /> |
|||
|
|||
<Style Selector="^:vertical"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="Root"> |
|||
<Border x:Name="VerticalRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}"> |
|||
<Grid RowDefinitions="Auto,*,Auto"> |
|||
<Rectangle x:Name="TrackRect" |
|||
Fill="{DynamicResource ScrollBarTrackFill}" |
|||
Stroke="{DynamicResource ScrollBarTrackStroke}" |
|||
StrokeThickness="{DynamicResource ScrollBarTrackBorderThemeThickness}" |
|||
Opacity="0" |
|||
Grid.RowSpan="3"> |
|||
<Rectangle.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Rectangle.Transitions> |
|||
</Rectangle> |
|||
|
|||
<RepeatButton Name="PART_LineUpButton" |
|||
HorizontalAlignment="Center" |
|||
Theme="{StaticResource FluentScrollBarLineButton}" |
|||
Grid.Row="0" |
|||
Focusable="False" |
|||
MinWidth="{DynamicResource ScrollBarSize}" |
|||
Height="{DynamicResource ScrollBarSize}" |
|||
AutomationProperties.Name="Line up"> |
|||
<PathIcon Data="M 19.091797 14.970703 L 10 5.888672 L 0.908203 14.970703 L 0.029297 14.091797 L 10 4.111328 L 19.970703 14.091797 Z" |
|||
Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"/> |
|||
</RepeatButton> |
|||
|
|||
<Track Grid.Row="1" |
|||
Minimum="{TemplateBinding Minimum}" |
|||
Maximum="{TemplateBinding Maximum}" |
|||
Value="{TemplateBinding Value, Mode=TwoWay}" |
|||
DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" |
|||
ViewportSize="{TemplateBinding ViewportSize}" |
|||
Orientation="{TemplateBinding Orientation}" |
|||
IsDirectionReversed="True"> |
|||
<Track.DecreaseButton> |
|||
<RepeatButton Name="PART_PageUpButton" |
|||
Classes="largeIncrease" |
|||
Theme="{StaticResource FluentScrollBarPageButton}" |
|||
Focusable="False" |
|||
AutomationProperties.Name="Page up"/> |
|||
</Track.DecreaseButton> |
|||
<Track.IncreaseButton> |
|||
<RepeatButton Name="PART_PageDownButton" |
|||
Classes="largeIncrease" |
|||
Theme="{StaticResource FluentScrollBarPageButton}" |
|||
Focusable="False" |
|||
AutomationProperties.Name="Page down"/> |
|||
</Track.IncreaseButton> |
|||
<Thumb Theme="{StaticResource FluentScrollBarThumb}" |
|||
Width="{DynamicResource ScrollBarSize}" |
|||
MinHeight="{DynamicResource ScrollBarSize}" |
|||
RenderTransform="{DynamicResource VerticalSmallScrollThumbScaleTransform}" |
|||
RenderTransformOrigin="100%,50%" |
|||
AutomationProperties.Name="Position"/> |
|||
</Track> |
|||
|
|||
<RepeatButton Name="PART_LineDownButton" |
|||
HorizontalAlignment="Center" |
|||
Theme="{StaticResource FluentScrollBarLineButton}" |
|||
Grid.Row="2" |
|||
Focusable="False" |
|||
MinWidth="{DynamicResource ScrollBarSize}" |
|||
Height="{DynamicResource ScrollBarSize}" |
|||
AutomationProperties.Name="Line down"> |
|||
<PathIcon Data="M 18.935547 4.560547 L 19.814453 5.439453 L 10 15.253906 L 0.185547 5.439453 L 1.064453 4.560547 L 10 13.496094 Z" |
|||
Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"/> |
|||
</RepeatButton> |
|||
</Grid> |
|||
</Border> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="^:horizontal"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid x:Name="Root"> |
|||
<Border x:Name="HorizontalRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}"> |
|||
<Grid ColumnDefinitions="Auto,*,Auto"> |
|||
<Rectangle x:Name="TrackRect" |
|||
Fill="{DynamicResource ScrollBarTrackFill}" |
|||
Stroke="{DynamicResource ScrollBarTrackStroke}" |
|||
StrokeThickness="{DynamicResource ScrollBarTrackBorderThemeThickness}" |
|||
Opacity="0" |
|||
Grid.ColumnSpan="3"> |
|||
<Rectangle.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Rectangle.Transitions> |
|||
</Rectangle> |
|||
|
|||
<RepeatButton Name="PART_LineUpButton" |
|||
Theme="{StaticResource FluentScrollBarLineButton}" |
|||
VerticalAlignment="Center" |
|||
Grid.Column="0" |
|||
Focusable="False" |
|||
MinHeight="{DynamicResource ScrollBarSize}" |
|||
Width="{DynamicResource ScrollBarSize}" |
|||
AutomationProperties.Name="Column left"> |
|||
<PathIcon Data="M 14.091797 19.970703 L 4.111328 10 L 14.091797 0.029297 L 14.970703 0.908203 L 5.888672 10 L 14.970703 19.091797 Z" |
|||
Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"/> |
|||
</RepeatButton> |
|||
|
|||
<Track Grid.Column="1" |
|||
Minimum="{TemplateBinding Minimum}" |
|||
Maximum="{TemplateBinding Maximum}" |
|||
Value="{TemplateBinding Value, Mode=TwoWay}" |
|||
DeferThumbDrag="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" |
|||
ViewportSize="{TemplateBinding ViewportSize}" |
|||
Orientation="{TemplateBinding Orientation}"> |
|||
<Track.DecreaseButton> |
|||
<RepeatButton Name="PART_PageUpButton" |
|||
Classes="largeIncrease" |
|||
Theme="{StaticResource FluentScrollBarPageButton}" |
|||
Focusable="False" |
|||
AutomationProperties.Name="Page left"/> |
|||
</Track.DecreaseButton> |
|||
<Track.IncreaseButton> |
|||
<RepeatButton Name="PART_PageDownButton" |
|||
Classes="largeIncrease" |
|||
Theme="{StaticResource FluentScrollBarPageButton}" |
|||
Focusable="False" |
|||
AutomationProperties.Name="Page right"/> |
|||
</Track.IncreaseButton> |
|||
<Thumb Theme="{StaticResource FluentScrollBarThumb}" |
|||
Height="{DynamicResource ScrollBarSize}" |
|||
MinWidth="{DynamicResource ScrollBarSize}" |
|||
RenderTransform="{DynamicResource HorizontalSmallScrollThumbScaleTransform}" |
|||
RenderTransformOrigin="50%,100%" |
|||
AutomationProperties.Name="Position"/> |
|||
</Track> |
|||
|
|||
<RepeatButton Name="PART_LineDownButton" |
|||
Theme="{StaticResource FluentScrollBarLineButton}" |
|||
VerticalAlignment="Center" |
|||
Grid.Column="2" |
|||
Focusable="False" |
|||
MinHeight="{DynamicResource ScrollBarSize}" |
|||
Width="{DynamicResource ScrollBarSize}" |
|||
AutomationProperties.Name="Column right"> |
|||
<PathIcon Data="M 5.029297 19.091797 L 14.111328 10 L 5.029297 0.908203 L 5.908203 0.029297 L 15.888672 10 L 5.908203 19.970703 Z" |
|||
Width="{DynamicResource ScrollBarButtonArrowIconFontSize}" |
|||
Height="{DynamicResource ScrollBarButtonArrowIconFontSize}"/> |
|||
</RepeatButton> |
|||
</Grid> |
|||
</Border> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="^[IsExpanded=true]"> |
|||
<Style Selector="^ /template/ Grid#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarBackgroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Rectangle#TrackRect"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarTrackFillPointerOver}" /> |
|||
<Setter Property="Stroke" Value="{DynamicResource ScrollBarTrackStrokePointerOver}" /> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource ScrollBarThumbBackgroundColor}" /> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ RepeatButton"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
@ -0,0 +1,71 @@ |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<ScrollViewer Width="200" Height="200" |
|||
HorizontalScrollBarVisibility="Auto"> |
|||
<StackPanel Spacing="20" Width="210"> |
|||
<TextBlock>Item 1</TextBlock> |
|||
<TextBlock>Item 2</TextBlock> |
|||
<TextBlock>Item 3</TextBlock> |
|||
<TextBlock>Item 4</TextBlock> |
|||
<TextBlock>Item 5</TextBlock> |
|||
<TextBlock>Item 6</TextBlock> |
|||
<TextBlock>Item 7</TextBlock> |
|||
<TextBlock>Item 8</TextBlock> |
|||
<TextBlock>Item 9</TextBlock> |
|||
</StackPanel> |
|||
</ScrollViewer> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type ScrollViewer}" TargetType="ScrollViewer"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid ColumnDefinitions="*,Auto" RowDefinitions="*,Auto"> |
|||
<ScrollContentPresenter Name="PART_ContentPresenter" |
|||
Grid.Row="0" |
|||
Grid.Column="0" |
|||
Background="{TemplateBinding Background}" |
|||
HorizontalSnapPointsType="{TemplateBinding HorizontalSnapPointsType}" |
|||
VerticalSnapPointsType="{TemplateBinding VerticalSnapPointsType}" |
|||
HorizontalSnapPointsAlignment="{TemplateBinding HorizontalSnapPointsAlignment}" |
|||
VerticalSnapPointsAlignment="{TemplateBinding VerticalSnapPointsAlignment}" |
|||
Padding="{TemplateBinding Padding}" |
|||
ScrollViewer.IsScrollInertiaEnabled="{TemplateBinding IsScrollInertiaEnabled}"> |
|||
<ScrollContentPresenter.GestureRecognizers> |
|||
<ScrollGestureRecognizer CanHorizontallyScroll="{Binding CanHorizontallyScroll, ElementName=PART_ContentPresenter}" |
|||
CanVerticallyScroll="{Binding CanVerticallyScroll, ElementName=PART_ContentPresenter}" |
|||
IsScrollInertiaEnabled="{Binding (ScrollViewer.IsScrollInertiaEnabled), ElementName=PART_ContentPresenter}"/> |
|||
</ScrollContentPresenter.GestureRecognizers> |
|||
</ScrollContentPresenter> |
|||
<ScrollBar Name="PART_HorizontalScrollBar" |
|||
Orientation="Horizontal" |
|||
Grid.Row="1"/> |
|||
<ScrollBar Name="PART_VerticalScrollBar" |
|||
Orientation="Vertical" |
|||
Grid.Column="1"/> |
|||
<Panel x:Name="PART_ScrollBarsSeparator" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}" |
|||
Opacity="0"> |
|||
<Panel.Transitions> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Panel.Transitions> |
|||
</Panel> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="^[AllowAutoHide=True] /template/ ScrollContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Grid.ColumnSpan" Value="2" /> |
|||
<Setter Property="Grid.RowSpan" Value="2" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,21 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<SelectableTextBlock Text="Preview" /> |
|||
</Design.PreviewWith> |
|||
|
|||
<MenuFlyout x:Key="SelectableTextBlockContextFlyout" Placement="Bottom"> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutCopyText}" Command="{Binding $parent[SelectableTextBlock].Copy}" |
|||
IsEnabled="{Binding $parent[SelectableTextBlock].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}" /> |
|||
</MenuFlyout> |
|||
|
|||
<ControlTheme x:Key="{x:Type SelectableTextBlock}" TargetType="SelectableTextBlock"> |
|||
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" /> |
|||
|
|||
<Style Selector="^[IsEnabled=True]"> |
|||
<Setter Property="Cursor" Value="IBeam" /> |
|||
<Setter Property="ContextFlyout" Value="{StaticResource SelectableTextBlockContextFlyout}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,23 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type Separator}" TargetType="Separator"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlForegroundBaseMediumLowBrush}" /> |
|||
<Setter Property="Focusable" Value="False" /> |
|||
<Setter Property="Height" Value="{DynamicResource MenuFlyoutSeparatorThemeHeight}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Margin" Value="{DynamicResource MenuFlyoutSeparatorThemePadding}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Padding="{TemplateBinding Margin}" |
|||
Height="{TemplateBinding Height}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalAlignment}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Background="{TemplateBinding Background}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,376 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Margin="20" Width="400" Height="600"> |
|||
<DockPanel LastChildFill="True"> |
|||
<StackPanel Spacing="10" DockPanel.Dock="Top"> |
|||
<Slider Value="50" /> |
|||
<Slider IsDirectionReversed="True" Value="50" /> |
|||
<Slider Value="50" TickPlacement="TopLeft" TickFrequency="10"/> |
|||
<Slider Value="50" TickPlacement="BottomRight" TickFrequency="10"/> |
|||
<Slider Value="50" TickPlacement="Outside" TickFrequency="10"/> |
|||
<Slider IsEnabled="False" Value="50" /> |
|||
<Slider Value="50"> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</Slider> |
|||
</StackPanel> |
|||
<StackPanel Spacing="10" Orientation="Horizontal"> |
|||
<Slider Value="50" Orientation="Vertical" /> |
|||
<Slider IsDirectionReversed="True" Value="50" Orientation="Vertical" /> |
|||
<Slider IsEnabled="False" Orientation="Vertical" Value="50" /> |
|||
<Slider Value="50" TickPlacement="TopLeft" TickFrequency="10" Orientation="Vertical" /> |
|||
<Slider Value="50" TickPlacement="BottomRight" TickFrequency="10" Orientation="Vertical" /> |
|||
<Slider Value="50" TickPlacement="Outside" TickFrequency="10" Orientation="Vertical" /> |
|||
</StackPanel> |
|||
</DockPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="SliderTopHeaderMargin">0,0,0,4</Thickness> |
|||
<GridLength x:Key="SliderPreContentMargin">15</GridLength> |
|||
<GridLength x:Key="SliderPostContentMargin">15</GridLength> |
|||
<x:Double x:Key="SliderHorizontalHeight">32</x:Double> |
|||
<x:Double x:Key="SliderVerticalWidth">32</x:Double> |
|||
<CornerRadius x:Key="SliderThumbCornerRadius">10</CornerRadius> |
|||
<x:Double x:Key="SliderHorizontalThumbWidth">20</x:Double> |
|||
<x:Double x:Key="SliderHorizontalThumbHeight">20</x:Double> |
|||
<x:Double x:Key="SliderVerticalThumbWidth">20</x:Double> |
|||
<x:Double x:Key="SliderVerticalThumbHeight">20</x:Double> |
|||
|
|||
<ControlTheme x:Key="FluentSliderHorizontalRepeatButton" TargetType="RepeatButton"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid> |
|||
<Border Name="FocusTarget" Margin="0,-10" Background="Transparent" /> |
|||
<Border Name="TrackBackground" |
|||
Background="{TemplateBinding Background}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
Height="{DynamicResource SliderTrackThemeHeight}" |
|||
VerticalAlignment="Center"/> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentSliderVerticalRepeatButton" TargetType="RepeatButton"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid> |
|||
<Border Name="FocusTarget" Margin="0,-10" Background="Transparent" /> |
|||
<Border Name="TrackBackground" |
|||
Background="{TemplateBinding Background}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
Width="{DynamicResource SliderTrackThemeHeight}" |
|||
HorizontalAlignment="Center"/> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentSliderThumbTheme" TargetType="Thumb"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{DynamicResource SliderThumbCornerRadius}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type Slider}" TargetType="Slider"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackFill}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource SliderBorderThemeThickness}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SliderTrackValueFill}" /> |
|||
<Style Selector="^:horizontal"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Border |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid x:Name="SliderContainer" |
|||
Margin="{TemplateBinding Padding}" |
|||
Background="{DynamicResource SliderContainerBackground}"> |
|||
<Grid.Styles> |
|||
<Style Selector="TickBar"> |
|||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> |
|||
</Style> |
|||
</Grid.Styles> |
|||
<Grid |
|||
x:Name="HorizontalTemplate" |
|||
MinHeight="{DynamicResource SliderHorizontalHeight}" |
|||
ColumnDefinitions="Auto,Auto,*"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="{DynamicResource SliderPreContentMargin}" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="{DynamicResource SliderPostContentMargin}" /> |
|||
</Grid.RowDefinitions> |
|||
<TickBar |
|||
Name="TopTickBar" |
|||
Grid.ColumnSpan="3" |
|||
Ticks="{TemplateBinding Ticks}" |
|||
TickFrequency="{TemplateBinding Slider.TickFrequency}" |
|||
Orientation="{TemplateBinding Slider.Orientation}" |
|||
Minimum="{TemplateBinding Slider.Minimum}" |
|||
Maximum="{TemplateBinding Slider.Maximum}" |
|||
Height="{DynamicResource SliderOutsideTickBarThemeHeight}" |
|||
Margin="0,0,0,4" |
|||
VerticalAlignment="Bottom" |
|||
Placement="Top" |
|||
IsVisible="False" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Fill="{DynamicResource SliderTickBarFill}"/> |
|||
<TickBar |
|||
Name="BottomTickBar" |
|||
Grid.Row="2" |
|||
Grid.ColumnSpan="3" |
|||
Ticks="{TemplateBinding Ticks}" |
|||
TickFrequency="{TemplateBinding Slider.TickFrequency}" |
|||
Orientation="{TemplateBinding Slider.Orientation}" |
|||
Minimum="{TemplateBinding Slider.Minimum}" |
|||
Maximum="{TemplateBinding Slider.Maximum}" |
|||
Height="{DynamicResource SliderOutsideTickBarThemeHeight}" |
|||
Margin="0,4,0,0" |
|||
VerticalAlignment="Top" |
|||
Placement="Bottom" |
|||
IsVisible="False" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Fill="{DynamicResource SliderTickBarFill}" /> |
|||
<Track |
|||
Name="PART_Track" |
|||
Grid.Row="1" |
|||
Grid.ColumnSpan="3" |
|||
Minimum="{TemplateBinding Minimum}" |
|||
Maximum="{TemplateBinding Maximum}" |
|||
Value="{TemplateBinding Value, Mode=TwoWay}" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Orientation="Horizontal"> |
|||
<Track.DecreaseButton> |
|||
<RepeatButton |
|||
Name="PART_DecreaseButton" |
|||
Theme="{StaticResource FluentSliderHorizontalRepeatButton}" |
|||
Background="{TemplateBinding Foreground}" |
|||
Focusable="False"/> |
|||
</Track.DecreaseButton> |
|||
<Track.IncreaseButton> |
|||
<RepeatButton |
|||
Name="PART_IncreaseButton" |
|||
Theme="{StaticResource FluentSliderHorizontalRepeatButton}" |
|||
Background="{TemplateBinding Background}" |
|||
Focusable="False"/> |
|||
</Track.IncreaseButton> |
|||
<Thumb |
|||
Name="thumb" |
|||
Width="{DynamicResource SliderHorizontalThumbWidth}" |
|||
Height="{DynamicResource SliderHorizontalThumbHeight}" |
|||
Margin="0" |
|||
Padding="0" |
|||
Background="{DynamicResource SliderThumbBackground}" |
|||
BorderThickness="0" |
|||
Theme="{StaticResource FluentSliderThumbTheme}" |
|||
DataContext="{TemplateBinding Value}"/> |
|||
</Track> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:vertical"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Border |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Grid x:Name="SliderContainer" |
|||
Grid.Row="1" |
|||
Background="{DynamicResource SliderContainerBackground}" |
|||
Margin="{TemplateBinding Padding}"> |
|||
<Grid.Styles> |
|||
<Style Selector="TickBar"> |
|||
<Setter Property="ReservedSpace" Value="{Binding #PART_Track.Thumb.Bounds}" /> |
|||
</Style> |
|||
</Grid.Styles> |
|||
<Grid |
|||
x:Name="VerticalTemplate" |
|||
MinWidth="{DynamicResource SliderVerticalWidth}" |
|||
RowDefinitions="*,Auto,Auto"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="{DynamicResource SliderPreContentMargin}" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="{DynamicResource SliderPostContentMargin}" /> |
|||
</Grid.ColumnDefinitions> |
|||
<TickBar |
|||
Name="LeftTickBar" |
|||
Grid.RowSpan="3" |
|||
Ticks="{TemplateBinding Ticks}" |
|||
TickFrequency="{TemplateBinding Slider.TickFrequency}" |
|||
Orientation="{TemplateBinding Slider.Orientation}" |
|||
Minimum="{TemplateBinding Slider.Minimum}" |
|||
Maximum="{TemplateBinding Slider.Maximum}" |
|||
Width="{DynamicResource SliderOutsideTickBarThemeHeight}" |
|||
Margin="0,0,4,0" |
|||
HorizontalAlignment="Right" |
|||
Placement="Left" |
|||
IsVisible="False" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Fill="{DynamicResource SliderTickBarFill}"/> |
|||
<TickBar |
|||
Name="RightTickBar" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="2" |
|||
Ticks="{TemplateBinding Ticks}" |
|||
TickFrequency="{TemplateBinding Slider.TickFrequency}" |
|||
Orientation="{TemplateBinding Slider.Orientation}" |
|||
Minimum="{TemplateBinding Slider.Minimum}" |
|||
Maximum="{TemplateBinding Slider.Maximum}" |
|||
Width="{DynamicResource SliderOutsideTickBarThemeHeight}" |
|||
Margin="4,0,0,0" |
|||
HorizontalAlignment="Left" |
|||
Placement="Right" |
|||
IsVisible="False" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Fill="{DynamicResource SliderTickBarFill}"/> |
|||
<Track |
|||
Name="PART_Track" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="1" |
|||
Grid.ColumnSpan="1" |
|||
Minimum="{TemplateBinding Minimum}" |
|||
Maximum="{TemplateBinding Maximum}" |
|||
Value="{TemplateBinding Value, Mode=TwoWay}" |
|||
IsDirectionReversed="{TemplateBinding IsDirectionReversed}" |
|||
Orientation="Vertical"> |
|||
<Track.DecreaseButton> |
|||
<RepeatButton |
|||
Name="PART_DecreaseButton" |
|||
Theme="{StaticResource FluentSliderVerticalRepeatButton}" |
|||
Background="{TemplateBinding Foreground}" |
|||
Focusable="False"/> |
|||
</Track.DecreaseButton> |
|||
<Track.IncreaseButton> |
|||
<RepeatButton |
|||
Name="PART_IncreaseButton" |
|||
Background="{TemplateBinding Background}" |
|||
Theme="{StaticResource FluentSliderVerticalRepeatButton}" |
|||
Focusable="False"/> |
|||
</Track.IncreaseButton> |
|||
<Thumb |
|||
Name="SliderThumb" |
|||
Width="{DynamicResource SliderVerticalThumbWidth}" |
|||
Height="{DynamicResource SliderVerticalThumbHeight}" |
|||
Margin="0" |
|||
Padding="0" |
|||
Background="{DynamicResource SliderThumbBackground}" |
|||
BorderThickness="0" |
|||
Theme="{StaticResource FluentSliderThumbTheme}" |
|||
DataContext="{TemplateBinding Value}" /> |
|||
</Track> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- TickBar Placement States --> |
|||
|
|||
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#LeftTickBar, ^[TickPlacement=Outside] /template/ TickBar#LeftTickBar"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[TickPlacement=TopLeft] /template/ TickBar#TopTickBar, ^[TickPlacement=Outside] /template/ TickBar#TopTickBar"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#BottomTickBar, ^[TickPlacement=Outside] /template/ TickBar#BottomTickBar"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[TickPlacement=BottomRight] /template/ TickBar#RightTickBar, ^[TickPlacement=Outside] /template/ TickBar#RightTickBar"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ Grid#SliderContainer"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderContainerBackgroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ RepeatButton#PART_IncreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackFillPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderThumbBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Grid#SliderContainer"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderContainerBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ RepeatButton#PART_DecreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackValueFillPointerOver}" /> |
|||
</Style> |
|||
|
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ Grid#SliderContainer"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderContainerBackgroundPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ RepeatButton#PART_DecreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackValueFillPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ RepeatButton#PART_IncreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackFillPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderThumbBackgroundPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Style Selector="^ /template/ RepeatButton#PART_DecreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackValueFillDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ RepeatButton#PART_IncreaseButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderTrackFillDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource SliderThumbBackgroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ TickBar"> |
|||
<Setter Property="Fill" Value="{DynamicResource SliderTickBarFillDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:error"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
|||
<Style Selector="^ /template/ Thumb"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,206 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="60"> |
|||
<StackPanel Spacing="20"> |
|||
<SplitButton Content="SplitButton"> |
|||
<SplitButton.Flyout> |
|||
<Flyout>Hello</Flyout> |
|||
</SplitButton.Flyout> |
|||
</SplitButton> |
|||
<SplitButton CornerRadius="16" Content="Rounded"> |
|||
<SplitButton.Flyout> |
|||
<Flyout>Hello</Flyout> |
|||
</SplitButton.Flyout> |
|||
</SplitButton> |
|||
<SplitButton IsEnabled="False">Disabled</SplitButton> |
|||
<ToggleSplitButton Content="ToggleSplitButton"> |
|||
<ToggleSplitButton.Flyout> |
|||
<Flyout>Hello</Flyout> |
|||
</ToggleSplitButton.Flyout> |
|||
</ToggleSplitButton> |
|||
<ToggleSplitButton Content="Checked" IsChecked="True"> |
|||
<ToggleSplitButton.Flyout> |
|||
<Flyout>Hello</Flyout> |
|||
</ToggleSplitButton.Flyout> |
|||
</ToggleSplitButton> |
|||
<ToggleSplitButton Content="Checked Disabled" IsChecked="True" IsEnabled="False"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="SplitButtonPrimaryButtonSize">32</x:Double> |
|||
<x:Double x:Key="SplitButtonSecondaryButtonSize">32</x:Double> |
|||
<x:Double x:Key="SplitButtonSeparatorWidth">1</x:Double> |
|||
<x:Double x:Key="SplitButtonMinHeight">32</x:Double> |
|||
|
|||
<converters:MarginMultiplierConverter x:Key="PrimaryButtonBorderMultiplier" Left="True" Top="True" Bottom="True" Indent="1" /> |
|||
<converters:MarginMultiplierConverter x:Key="SecondaryButtonBorderMultiplier" Right="True" Top="True" Bottom="True" Indent="1" /> |
|||
<converters:MarginMultiplierConverter x:Key="SeparatorBorderMultiplier" Top="True" Bottom="True" Indent="1" /> |
|||
|
|||
<ControlTheme x:Key="FluentSplitButtonComponent" TargetType="Button"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[Tag=flyout-open] /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[Tag=checked]"> |
|||
<Style Selector="^ /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundChecked}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushChecked}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundChecked}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundCheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushCheckedPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundCheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushCheckedPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundCheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushCheckedDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource SplitButtonForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^[Tag=checked-flyout-open] /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackgroundCheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrushCheckedPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForegroundCheckedPressed}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type SplitButton}" TargetType="SplitButton"> |
|||
<Setter Property="Background" Value="{DynamicResource SplitButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SplitButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SplitButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource SplitButtonBorderThemeThickness}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource SplitButtonMinHeight}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="KeyboardNavigation.IsTabStop" Value="True" /> |
|||
<Setter Property="Focusable" Value="True" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Button x:Name="PART_PrimaryButton" |
|||
Grid.Column="0" |
|||
Theme="{StaticResource FluentSplitButtonComponent}" |
|||
MinWidth="{DynamicResource SplitButtonPrimaryButtonSize}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource PrimaryButtonBorderMultiplier}}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Command="{TemplateBinding Command}" |
|||
CommandParameter="{TemplateBinding CommandParameter}" |
|||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource LeftCornerRadiusFilterConverter}}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Padding="{TemplateBinding Padding}" |
|||
Focusable="False" |
|||
KeyboardNavigation.IsTabStop="False" /> |
|||
|
|||
<Border x:Name="SeparatorBorder" |
|||
Grid.Column="1" |
|||
Background="Transparent" |
|||
Width="{DynamicResource SplitButtonSeparatorWidth}" |
|||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SeparatorBorderMultiplier}}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" /> |
|||
|
|||
<Button x:Name="PART_SecondaryButton" |
|||
Grid.Column="2" |
|||
Theme="{StaticResource FluentSplitButtonComponent}" |
|||
MinWidth="{DynamicResource SplitButtonSecondaryButtonSize}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness, Converter={StaticResource SecondaryButtonBorderMultiplier}}" |
|||
CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}" |
|||
Padding="0" |
|||
HorizontalContentAlignment="Center" |
|||
VerticalContentAlignment="Center" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
Focusable="False" |
|||
KeyboardNavigation.IsTabStop="False"> |
|||
<PathIcon Height="12" Width="12" |
|||
Data="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|||
</Button> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:flyout-open /template/ Button"> |
|||
<Setter Property="Tag" Value="flyout-open" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Button"> |
|||
<Setter Property="Tag" Value="checked" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked:flyout-open /template/ Button"> |
|||
<Setter Property="Tag" Value="checked-flyout-open" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,455 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Width="400" Height="400"> |
|||
<SplitView DisplayMode="Inline" |
|||
IsPaneOpen="True"> |
|||
<SplitView.Pane> |
|||
<Border Background="Green" /> |
|||
</SplitView.Pane> |
|||
<SplitView.Content> |
|||
<Border Background="Blue" /> |
|||
</SplitView.Content> |
|||
</SplitView> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="SplitViewOpenPaneThemeLength">320</x:Double> |
|||
<x:Double x:Key="SplitViewCompactPaneThemeLength">48</x:Double> |
|||
<sys:TimeSpan x:Key="SplitViewPaneAnimationOpenDuration">00:00:00.2</sys:TimeSpan> |
|||
<sys:TimeSpan x:Key="SplitViewPaneAnimationCloseDuration">00:00:00.1</sys:TimeSpan> |
|||
<Easing x:Key="SplitViewPaneAnimationEasing">0.1,0.9,0.2,1.0</Easing> |
|||
|
|||
<ControlTheme x:Key="{x:Type SplitView}" TargetType="SplitView"> |
|||
<Setter Property="OpenPaneLength" Value="{DynamicResource SplitViewOpenPaneThemeLength}" /> |
|||
<Setter Property="CompactPaneLength" Value="{DynamicResource SplitViewCompactPaneThemeLength}" /> |
|||
<Setter Property="PaneBackground" Value="{DynamicResource SystemControlPageBackgroundChromeLowBrush}" /> |
|||
|
|||
<Style Selector="^:left"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="Container" Background="{TemplateBinding Background}"> |
|||
<Grid.ColumnDefinitions> |
|||
<!-- why is this throwing a binding error? --> |
|||
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}"/> |
|||
<ColumnDefinition Width="*"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Panel Name="PART_PaneRoot" |
|||
Background="{TemplateBinding PaneBackground}" |
|||
ClipToBounds="True" |
|||
HorizontalAlignment="Left" |
|||
ZIndex="100"> |
|||
<ContentPresenter x:Name="PART_PanePresenter" |
|||
Content="{TemplateBinding Pane}" |
|||
ContentTemplate="{TemplateBinding PaneTemplate}" /> |
|||
<Rectangle Name="HCPaneBorder" |
|||
Fill="{DynamicResource SystemControlForegroundTransparentBrush}" |
|||
Width="1" |
|||
HorizontalAlignment="Right" /> |
|||
</Panel> |
|||
|
|||
<Panel Name="ContentRoot" Grid.Column="1"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Rectangle Name="LightDismissLayer" |
|||
Fill="Transparent" |
|||
IsVisible="False"/> |
|||
</Panel> |
|||
|
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:overlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactinline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactoverlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:inline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:right"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="Container" Background="{TemplateBinding Background}"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="*"/> |
|||
<ColumnDefinition Width="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneColumnGridLength}"/> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Panel Name="PART_PaneRoot" Background="{TemplateBinding PaneBackground}" |
|||
ClipToBounds="True" |
|||
HorizontalAlignment="Right" |
|||
ZIndex="100"> |
|||
<ContentPresenter x:Name="PART_PanePresenter" |
|||
Content="{TemplateBinding Pane}" |
|||
ContentTemplate="{TemplateBinding PaneTemplate}"/> |
|||
<Rectangle Name="HCPaneBorder" |
|||
Fill="{DynamicResource SystemControlForegroundTransparentBrush}" |
|||
Width="1" HorizontalAlignment="Left" /> |
|||
</Panel> |
|||
|
|||
<Panel Name="ContentRoot" Grid.Column="0"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Rectangle Name="LightDismissLayer" Fill="Transparent" IsVisible="False"/> |
|||
</Panel> |
|||
|
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:overlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactinline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactoverlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="2"/> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:inline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
<Setter Property="Grid.Column" Value="1"/> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Column" Value="0"/> |
|||
<Setter Property="Grid.ColumnSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- TOP placement --> |
|||
<Style Selector="^:top"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="Container" Background="{TemplateBinding Background}"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneRowGridLength}"/> |
|||
<RowDefinition Height="*"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Panel Name="PART_PaneRoot" |
|||
Background="{TemplateBinding PaneBackground}" |
|||
ClipToBounds="True" |
|||
VerticalAlignment="Top" |
|||
ZIndex="100"> |
|||
<ContentPresenter x:Name="PART_PanePresenter" |
|||
Content="{TemplateBinding Pane}" |
|||
ContentTemplate="{TemplateBinding PaneTemplate}" /> |
|||
<Rectangle Name="HCPaneBorder" |
|||
Fill="{DynamicResource SystemControlForegroundTransparentBrush}" |
|||
Height="1" |
|||
VerticalAlignment="Bottom" /> |
|||
</Panel> |
|||
|
|||
<Panel Name="ContentRoot" Grid.Row="1"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Rectangle Name="LightDismissLayer" |
|||
Fill="Transparent" |
|||
IsVisible="False"/> |
|||
</Panel> |
|||
|
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:overlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Grid.RowSpan" Value="2"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactinline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactoverlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:inline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- BOTTOM placement --> |
|||
<Style Selector="^:bottom"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Name="Container" Background="{TemplateBinding Background}"> |
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="*"/> |
|||
<RowDefinition Height="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.PaneRowGridLength}"/> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Panel Name="PART_PaneRoot" Background="{TemplateBinding PaneBackground}" |
|||
ClipToBounds="True" |
|||
VerticalAlignment="Bottom" |
|||
ZIndex="100"> |
|||
<ContentPresenter x:Name="PART_PanePresenter" |
|||
Content="{TemplateBinding Pane}" |
|||
ContentTemplate="{TemplateBinding PaneTemplate}"/> |
|||
<Rectangle Name="HCPaneBorder" |
|||
Fill="{DynamicResource SystemControlForegroundTransparentBrush}" |
|||
Height="1" VerticalAlignment="Top" /> |
|||
</Panel> |
|||
|
|||
<Panel Name="ContentRoot" Grid.Row="0"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Rectangle Name="LightDismissLayer" Fill="Transparent" IsVisible="False"/> |
|||
</Panel> |
|||
|
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:overlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
<Setter Property="Grid.RowSpan" Value="2"/> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Grid.RowSpan" Value="2"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactinline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:compactoverlay"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="2"/> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:inline"> |
|||
<Style Selector="^ /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
<Setter Property="Grid.Row" Value="1"/> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Panel#ContentRoot"> |
|||
<Setter Property="Grid.Row" Value="0"/> |
|||
<Setter Property="Grid.RowSpan" Value="1"/> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Placement-specific open/closed transitions for horizontal panes (left/right) --> |
|||
<Style Selector="^:left:open /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Width" |
|||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" |
|||
Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" /> |
|||
</Style> |
|||
<Style Selector="^:right:open /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Width" |
|||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" |
|||
Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:left:closed /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Width" Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
<Style Selector="^:right:closed /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Width" Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Width" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneWidth}" /> |
|||
</Style> |
|||
|
|||
<!-- Placement-specific open/closed transitions for vertical panes (top/bottom) --> |
|||
<Style Selector="^:top:open /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Height" |
|||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" |
|||
Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:bottom:open /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Height" |
|||
Duration="{StaticResource SplitViewPaneAnimationOpenDuration}" |
|||
Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=OpenPaneLength}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:top:closed /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Height" Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:bottom:closed /template/ Panel#PART_PaneRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Height" Duration="{StaticResource SplitViewPaneAnimationCloseDuration}" Easing="{StaticResource SplitViewPaneAnimationEasing}" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Height" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=TemplateSettings.ClosedPaneHeight}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:lightDismiss /template/ Rectangle#LightDismissLayer"> |
|||
<Setter Property="Fill" Value="{DynamicResource SplitViewLightDismissOverlayBackground}" /> |
|||
</Style> |
|||
<Style Selector="^:overlay:open /template/ Rectangle#LightDismissLayer"> |
|||
<Setter Property="IsVisible" Value="True"/> |
|||
</Style> |
|||
<Style Selector="^:compactoverlay:open /template/ Rectangle#LightDismissLayer"> |
|||
<Setter Property="IsVisible" Value="True"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,64 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Width="400"> |
|||
<TabControl> |
|||
<TabItem Header="Arch"> |
|||
<Border Background="AntiqueWhite" Height="100"> |
|||
<TextBlock Text="Content" Foreground="Black" FontSize="20"/> |
|||
</Border> |
|||
</TabItem> |
|||
<TabItem Header="Leaf"> |
|||
<Border Background="Green" Height="100" /> |
|||
</TabItem> |
|||
<TabItem Header="Disabled" IsEnabled="False" /> |
|||
</TabControl> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="TabControlTopPlacementItemMargin">0 0 0 2</Thickness> |
|||
|
|||
<ControlTheme x:Key="{x:Type TabControl}" TargetType="TabControl"> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TabItemMargin}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TabControlBackground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Background="{TemplateBinding Background}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalAlignment}"> |
|||
<DockPanel> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
DockPanel.Dock="{TemplateBinding TabStripPlacement}" /> |
|||
<Panel ClipToBounds="True"> |
|||
<ContentPresenter Name="PART_SelectedContentHost2" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
IsVisible="False" /> |
|||
<ContentPresenter Name="PART_SelectedContentHost" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</Panel> |
|||
</DockPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel"> |
|||
<Setter Property="Orientation" Value="Vertical" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel"> |
|||
<Setter Property="Orientation" Value="Vertical" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter"> |
|||
<Setter Property="Margin" Value="{DynamicResource TabControlTopPlacementItemMargin}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,131 @@ |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabItem Header="Leaf" /> |
|||
<TabItem Header="Arch" IsSelected="True" /> |
|||
<TabItem Header="Background" Background="Yellow"/> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="TabItemMinHeight">48</x:Double> |
|||
<x:Double x:Key="TabItemVerticalPipeHeight">24</x:Double> |
|||
<x:Double x:Key="TabItemPipeThickness">2</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type TabItem}" TargetType="TabItem"> |
|||
<Setter Property="FontSize" Value="{DynamicResource TabItemHeaderFontSize}" /> |
|||
<Setter Property="FontWeight" Value="{DynamicResource TabItemHeaderThemeFontWeight}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselected}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TabItemHeaderMargin}" /> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TabItemMinHeight}" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border |
|||
Name="PART_LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Panel> |
|||
<ContentPresenter |
|||
Name="PART_ContentPresenter" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
/> |
|||
<Border Name="PART_SelectedPipe" |
|||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
IsVisible="False"/> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background --> |
|||
<Style Selector="^:selected"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="^:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected PointerOver state --> |
|||
<Style Selector="^:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed state --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Pressed state --> |
|||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled state --> |
|||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- TabStripPlacement States Group --> |
|||
<Style Selector="^[TabStripPlacement=Left] /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="Width" Value="{DynamicResource TabItemPipeThickness}" /> |
|||
<Setter Property="Height" Value="{DynamicResource TabItemVerticalPipeHeight}" /> |
|||
<Setter Property="Margin" Value="0,0,2,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Left] /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="8,0,0,0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[TabStripPlacement=Top] /template/ Border#PART_SelectedPipe, ^[TabStripPlacement=Bottom] /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="Height" Value="{DynamicResource TabItemPipeThickness}" /> |
|||
<Setter Property="Margin" Value="0,0,0,2" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^[TabStripPlacement=Right] /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="Width" Value="{DynamicResource TabItemPipeThickness}" /> |
|||
<Setter Property="Height" Value="{DynamicResource TabItemVerticalPipeHeight}" /> |
|||
<Setter Property="Margin" Value="2,0,0,0" /> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Right] /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="0,0,8,0" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Right]"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Right" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,33 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<TabStrip> |
|||
<TabStripItem>Item 1</TabStripItem> |
|||
<TabStripItem>Item 2</TabStripItem> |
|||
<TabStripItem IsEnabled="False">Disabled</TabStripItem> |
|||
</TabStrip> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type TabStrip}" TargetType="TabStrip"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ItemsPanel"> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel /> |
|||
</ItemsPanelTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,95 @@ |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabStripItem>Leaf</TabStripItem> |
|||
<TabStripItem IsSelected="True">Arch</TabStripItem> |
|||
<TabStripItem Background="Yellow">Background</TabStripItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="TabStripItemMinHeight">48</x:Double> |
|||
<x:Double x:Key="TabStripItemPipeThickness">2</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type TabStripItem}" TargetType="TabStripItem"> |
|||
<Setter Property="FontSize" Value="{DynamicResource TabItemHeaderFontSize}" /> |
|||
<Setter Property="FontWeight" Value="{DynamicResource TabItemHeaderThemeFontWeight}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselected}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TabItemHeaderMargin}" /> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TabStripItemMinHeight}" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border |
|||
Name="PART_LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Panel> |
|||
<ContentPresenter |
|||
Name="PART_ContentPresenter" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
<Border Name="PART_SelectedPipe" |
|||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" |
|||
CornerRadius="{DynamicResource ControlCornerRadius}" |
|||
Height="{DynamicResource TabStripItemPipeThickness}" |
|||
IsVisible="False" |
|||
Margin="0,0,0,2" |
|||
VerticalAlignment="Bottom"/> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Selected state --> |
|||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background --> |
|||
<Style Selector="^:selected"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="^:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected PointerOver state --> |
|||
<Style Selector="^:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed state --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Pressed state --> |
|||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled state --> |
|||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,262 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Width="400" Height="400"> |
|||
<TabbedPage> |
|||
<ContentPage Header="Home"> |
|||
<TextBlock Text="Home page" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
<ContentPage Header="Favorites"> |
|||
<TextBlock Text="Favorites page" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
<ContentPage Header="Profile"> |
|||
<TextBlock Text="Profile page" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</ContentPage> |
|||
</TabbedPage> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<!-- Backgrounds --> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundUnselected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundSelected" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundUnselectedPointerOver" Color="{DynamicResource SystemListLowColor}" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundSelectedPointerOver" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundUnselectedPressed" Color="{DynamicResource SystemListMediumColor}" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundSelectedPressed" Color="Transparent" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderBackgroundDisabled" Color="Transparent" /> |
|||
|
|||
<!-- Foregrounds (override via TabbedPageTabItemHeaderForegroundSelected / TabbedPageTabItemHeaderForegroundUnselected resources) --> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderForegroundUnselected" Color="{DynamicResource SystemBaseMediumColor}" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderForegroundSelected" Color="{DynamicResource SystemAccentColor}" /> |
|||
<SolidColorBrush x:Key="TabbedPageTabItemHeaderForegroundDisabled" Color="{DynamicResource SystemBaseLowColor}" /> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderPipeThickness">2</x:Double> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderVerticalPipeHeight">18</x:Double> |
|||
|
|||
<CornerRadius x:Key="TabbedPageTabItemHeaderIndicatorCornerRadius">0</CornerRadius> |
|||
<Thickness x:Key="TabbedPageTabItemHeaderIndicatorMargin">0</Thickness> |
|||
|
|||
<!-- Tab item sizing & shape --> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderMinHeight">48</x:Double> |
|||
<CornerRadius x:Key="TabbedPageTabItemHeaderCornerRadius">0</CornerRadius> |
|||
<Thickness x:Key="TabbedPageTabItemHeaderPadding">8,4</Thickness> |
|||
<Thickness x:Key="TabbedPageTabItemHeaderMargin">0</Thickness> |
|||
|
|||
<!-- Icon + text header layout --> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderIconSize">20</x:Double> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderFontSize">12</x:Double> |
|||
<x:Double x:Key="TabbedPageTabItemHeaderSpacing">4</x:Double> |
|||
|
|||
<!-- Tab strip (bar) styling --> |
|||
<SolidColorBrush x:Key="TabbedPageTabStripBackground" Color="Transparent" /> |
|||
<CornerRadius x:Key="TabbedPageTabStripCornerRadius">0</CornerRadius> |
|||
<Thickness x:Key="TabbedPageTabStripBorderThickness">0</Thickness> |
|||
<SolidColorBrush x:Key="TabbedPageTabStripBorderBrush" Color="Transparent" /> |
|||
<Thickness x:Key="TabbedPageTabStripMargin">0</Thickness> |
|||
<Thickness x:Key="TabbedPageTabStripPadding">0</Thickness> |
|||
|
|||
<!-- TabbedPage TabControl theme --> |
|||
<ControlTheme x:Key="TabbedPageTabControlTheme" TargetType="TabControl"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabStripBackground}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource TabbedPageTabStripCornerRadius}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TabbedPageTabStripBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TabbedPageTabStripBorderThickness}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TabbedPageTabStripPadding}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel> |
|||
<Border Name="PART_TabStrip" |
|||
Background="{TemplateBinding Background}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Margin="{DynamicResource TabbedPageTabStripMargin}" |
|||
Padding="{TemplateBinding Padding}" |
|||
DockPanel.Dock="{TemplateBinding TabStripPlacement}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter"> |
|||
<ItemsPresenter.ItemsPanel> |
|||
<ItemsPanelTemplate> |
|||
<UniformGrid Rows="1" /> |
|||
</ItemsPanelTemplate> |
|||
</ItemsPresenter.ItemsPanel> |
|||
</ItemsPresenter> |
|||
</Border> |
|||
<Panel ClipToBounds="True"> |
|||
<ContentPresenter Name="PART_SelectedContentHost2" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
IsVisible="False" /> |
|||
<ContentPresenter Name="PART_SelectedContentHost" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" /> |
|||
</Panel> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > UniformGrid, |
|||
^[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > UniformGrid"> |
|||
<Setter Property="Rows" Value="0" /> |
|||
<Setter Property="Columns" Value="1" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- TabbedPage TabItem theme --> |
|||
<ControlTheme x:Key="TabbedPageTabItemTheme" TargetType="TabItem"> |
|||
<Setter Property="FontSize" Value="{DynamicResource TabItemHeaderFontSize}" /> |
|||
<Setter Property="FontWeight" Value="{DynamicResource TabItemHeaderThemeFontWeight}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundUnselected}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TabbedPageTabItemHeaderPadding}" /> |
|||
<Setter Property="Margin" Value="{DynamicResource TabbedPageTabItemHeaderMargin}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TabbedPageTabItemHeaderMinHeight}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource TabbedPageTabItemHeaderCornerRadius}" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="IndicatorTemplate"> |
|||
<DataTemplate> |
|||
<Border Background="{Binding $parent[TabItem].Foreground}" |
|||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}" |
|||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" /> |
|||
</DataTemplate> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_LayoutRoot" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<StackPanel Name="PART_HeaderPanel" |
|||
Spacing="{DynamicResource TabbedPageTabItemHeaderSpacing}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
|||
<ContentPresenter Name="PART_IconPresenter" |
|||
Content="{TemplateBinding Icon}" |
|||
ContentTemplate="{TemplateBinding IconTemplate}" |
|||
HorizontalAlignment="Center" |
|||
IsVisible="{TemplateBinding Icon, Converter={x:Static ObjectConverters.IsNotNull}}" |
|||
Width="{DynamicResource TabbedPageTabItemHeaderIconSize}" |
|||
Height="{DynamicResource TabbedPageTabItemHeaderIconSize}" /> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
HorizontalAlignment="Center" |
|||
HorizontalContentAlignment="Center" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{DynamicResource TabbedPageTabItemHeaderFontSize}" |
|||
FontWeight="{TemplateBinding FontWeight}" /> |
|||
</StackPanel> |
|||
</Border> |
|||
<ContentPresenter Name="PART_SelectedPipe" |
|||
VerticalAlignment="Bottom" |
|||
HorizontalAlignment="Stretch" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
Content="{TemplateBinding DataContext}" |
|||
ContentTemplate="{TemplateBinding IndicatorTemplate}" |
|||
IsVisible="False" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Selected state --> |
|||
<Style Selector="^:selected"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ ContentPresenter#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<!-- Placement-specific pipe positioning --> |
|||
<Style Selector="^[TabStripPlacement=Top] /template/ ContentPresenter#PART_SelectedPipe"> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
<Setter Property="Height" Value="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Bottom] /template/ ContentPresenter#PART_SelectedPipe"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="Height" Value="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Right]"> |
|||
<Setter Property="IndicatorTemplate"> |
|||
<DataTemplate> |
|||
<Border Background="{Binding $parent[TabItem].Foreground}" |
|||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}" |
|||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}" |
|||
Width="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" |
|||
Height="{DynamicResource TabbedPageTabItemHeaderVerticalPipeHeight}" /> |
|||
</DataTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Right] /template/ ContentPresenter#PART_SelectedPipe"> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Left]"> |
|||
<Setter Property="IndicatorTemplate"> |
|||
<DataTemplate> |
|||
<Border Background="{Binding $parent[TabItem].Foreground}" |
|||
CornerRadius="{DynamicResource TabbedPageTabItemHeaderIndicatorCornerRadius}" |
|||
Margin="{DynamicResource TabbedPageTabItemHeaderIndicatorMargin}" |
|||
Width="{DynamicResource TabbedPageTabItemHeaderPipeThickness}" |
|||
Height="{DynamicResource TabbedPageTabItemHeaderVerticalPipeHeight}" /> |
|||
</DataTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^[TabStripPlacement=Left] /template/ ContentPresenter#PART_SelectedPipe"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
</Style> |
|||
|
|||
<!-- Pointer-over --> |
|||
<Style Selector="^:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected + pointer-over --> |
|||
<Style Selector="^:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundUnselectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected + pressed --> |
|||
<Style Selector="^:selected:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundSelectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled --> |
|||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabbedPageTabItemHeaderBackgroundDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabbedPageTabItemHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Focus visible --> |
|||
<Style Selector="^:focus-visible /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="BorderThickness" Value="2" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type TabbedPage}" TargetType="TabbedPage"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlPageBackgroundAltHighBrush}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel Background="{TemplateBinding Background}"> |
|||
<TabControl Name="PART_TabControl" |
|||
Theme="{StaticResource TabbedPageTabControlTheme}" |
|||
ItemContainerTheme="{StaticResource TabbedPageTabItemTheme}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,282 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TextBox>Left</TextBox> |
|||
<TextBox TextAlignment="Center">Center</TextBox> |
|||
<TextBox Classes="clearButton">Clear</TextBox> |
|||
<TextBox PasswordChar="*" Classes="revealPasswordButton">Reveal Password</TextBox> |
|||
<TextBox PasswordChar="*" Classes="revealPasswordButton" RevealPassword="True">Password Revealed</TextBox> |
|||
<TextBox PlaceholderText="Placeholder"/> |
|||
<TextBox PlaceholderText="Floating Placeholder" UseFloatingPlaceholder="True"/> |
|||
<TextBox PlaceholderText="Floating Placeholder" UseFloatingPlaceholder="True">Content</TextBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="TextBoxTopHeaderMargin">0,0,0,4</Thickness> |
|||
<StreamGeometry x:Key="TextBoxClearButtonData">M 11.416016,10 20,1.4160156 18.583984,0 10,8.5839846 1.4160156,0 0,1.4160156 8.5839844,10 0,18.583985 1.4160156,20 10,11.416015 18.583984,20 20,18.583985 Z</StreamGeometry> |
|||
<StreamGeometry x:Key="PasswordBoxRevealButtonData">m10.051 7.0032c2.215 0 4.0105 1.7901 4.0105 3.9984s-1.7956 3.9984-4.0105 3.9984c-2.215 0-4.0105-1.7901-4.0105-3.9984s1.7956-3.9984 4.0105-3.9984zm0 1.4994c-1.3844 0-2.5066 1.1188-2.5066 2.499s1.1222 2.499 2.5066 2.499 2.5066-1.1188 2.5066-2.499-1.1222-2.499-2.5066-2.499zm0-5.0026c4.6257 0 8.6188 3.1487 9.7267 7.5613 0.10085 0.40165-0.14399 0.80877-0.54686 0.90931-0.40288 0.10054-0.81122-0.14355-0.91208-0.54521-0.94136-3.7492-4.3361-6.4261-8.2678-6.4261-3.9334 0-7.3292 2.6792-8.2689 6.4306-0.10063 0.40171-0.50884 0.64603-0.91177 0.54571s-0.648-0.5073-0.54737-0.90901c1.106-4.4152 5.1003-7.5667 9.728-7.5667z</StreamGeometry> |
|||
<StreamGeometry x:Key="PasswordBoxHideButtonData">m0.21967 0.21965c-0.26627 0.26627-0.29047 0.68293-0.07262 0.97654l0.07262 0.08412 4.0346 4.0346c-1.922 1.3495-3.3585 3.365-3.9554 5.7495-0.10058 0.4018 0.14362 0.8091 0.54543 0.9097 0.40182 0.1005 0.80909-0.1436 0.90968-0.5455 0.52947-2.1151 1.8371-3.8891 3.5802-5.0341l1.8096 1.8098c-0.70751 0.7215-1.1438 1.71-1.1438 2.8003 0 2.2092 1.7909 4 4 4 1.0904 0 2.0788-0.4363 2.8004-1.1438l5.9193 5.9195c0.2929 0.2929 0.7677 0.2929 1.0606 0 0.2663-0.2662 0.2905-0.6829 0.0726-0.9765l-0.0726-0.0841-6.1135-6.1142 0.0012-0.0015-1.2001-1.1979-2.8699-2.8693 2e-3 -8e-4 -2.8812-2.8782 0.0012-0.0018-1.1333-1.1305-4.3064-4.3058c-0.29289-0.29289-0.76777-0.29289-1.0607 0zm7.9844 9.0458 3.5351 3.5351c-0.45 0.4358-1.0633 0.704-1.7392 0.704-1.3807 0-2.5-1.1193-2.5-2.5 0-0.6759 0.26824-1.2892 0.7041-1.7391zm1.7959-5.7655c-1.0003 0-1.9709 0.14807-2.8889 0.425l1.237 1.2362c0.5358-0.10587 1.0883-0.16119 1.6519-0.16119 3.9231 0 7.3099 2.6803 8.2471 6.4332 0.1004 0.4018 0.5075 0.6462 0.9094 0.5459 0.4019-0.1004 0.6463-0.5075 0.5459-0.9094-1.103-4.417-5.0869-7.5697-9.7024-7.5697zm0.1947 3.5093 3.8013 3.8007c-0.1018-2.0569-1.7488-3.7024-3.8013-3.8007z</StreamGeometry> |
|||
|
|||
<MenuFlyout x:Key="DefaultTextBoxContextFlyout" ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}"> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutCutText}" Command="{Binding $parent[TextBox].Cut}" IsEnabled="{Binding $parent[TextBox].CanCut}" InputGesture="{x:Static TextBox.CutGesture}" /> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutCopyText}" Command="{Binding $parent[TextBox].Copy}" IsEnabled="{Binding $parent[TextBox].CanCopy}" InputGesture="{x:Static TextBox.CopyGesture}"/> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutPasteText}" Command="{Binding $parent[TextBox].Paste}" IsEnabled="{Binding $parent[TextBox].CanPaste}" InputGesture="{x:Static TextBox.PasteGesture}"/> |
|||
</MenuFlyout> |
|||
<MenuFlyout x:Key="HorizontalTextBoxContextFlyout" ShowMode="{OnFormFactor Desktop=Standard, Mobile=Transient}" FlyoutPresenterTheme="{StaticResource HorizontalMenuFlyoutPresenter}" ItemContainerTheme="{StaticResource HorizontalMenuItem}"> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutCutText}" Command="{Binding $parent[TextBox].Cut}" IsEnabled="{Binding $parent[TextBox].CanCut}" IsVisible="{Binding $parent[TextBox].CanCut}" /> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutCopyText}" Command="{Binding $parent[TextBox].Copy}" IsEnabled="{Binding $parent[TextBox].CanCopy}" IsVisible="{Binding $parent[TextBox].CanCopy}" /> |
|||
<MenuItem Header="{DynamicResource StringTextFlyoutPasteText}" Command="{Binding $parent[TextBox].Paste}" IsEnabled="{Binding $parent[TextBox].CanPaste}" /> |
|||
</MenuFlyout> |
|||
|
|||
<ControlTheme x:Key="FluentTextBoxButton" TargetType="Button"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrush}" /> |
|||
<Setter Property="Focusable" Value="False"/> |
|||
<Setter Property="MinWidth" Value="34" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="Width" Value="{Binding $self.Bounds.Height}"/> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TextControlButtonForeground}"/> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="Button"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
</ContentPresenter> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="FluentTextBoxToggleButton" |
|||
TargetType="ToggleButton" |
|||
BasedOn="{StaticResource FluentTextBoxButton}"> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate TargetType="ToggleButton"> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
</ContentPresenter> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:checked /template/ ContentPresenter, ^:indeterminate /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPressed}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type TextBox}" TargetType="TextBox"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<Setter Property="CaretBrush" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="SelectionBrush" Value="{DynamicResource TextControlSelectionHighlightColor}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource TextControlPlaceholderForeground}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="FocusAdorner" Value="{x:Null}" /> |
|||
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> |
|||
<Setter Property="ContextFlyout" Value="{OnFormFactor Desktop={StaticResource DefaultTextBoxContextFlyout}, Mobile={StaticResource HorizontalTextBoxContextFlyout}}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Panel> |
|||
<Border |
|||
Name="PART_BorderElement" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
MinWidth="{TemplateBinding MinWidth}" |
|||
MinHeight="{TemplateBinding MinHeight}"> |
|||
</Border> |
|||
|
|||
<Border |
|||
Margin="{TemplateBinding BorderThickness}"> |
|||
<Grid ColumnDefinitions="Auto,*,Auto" > |
|||
<ContentPresenter Grid.Column="0" |
|||
Grid.ColumnSpan="1" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding InnerLeftContent}"/> |
|||
<DockPanel x:Name="PART_InnerDockPanel" |
|||
Grid.Column="1" |
|||
Grid.ColumnSpan="1" |
|||
Margin="{TemplateBinding Padding}"> |
|||
<TextBlock Name="PART_FloatingPlaceholder" |
|||
Foreground="{TemplateBinding PlaceholderForeground}" |
|||
IsVisible="False" |
|||
Text="{TemplateBinding PlaceholderText}" |
|||
DockPanel.Dock="Top" /> |
|||
|
|||
<ScrollViewer Name="PART_ScrollViewer" |
|||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}" |
|||
BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"> |
|||
<Panel> |
|||
<TextBlock Name="PART_Placeholder" |
|||
Foreground="{TemplateBinding PlaceholderForeground}" |
|||
Opacity="{DynamicResource TextControlPlaceholderOpacity}" |
|||
Text="{TemplateBinding PlaceholderText}" |
|||
TextAlignment="{TemplateBinding TextAlignment}" |
|||
TextWrapping="{TemplateBinding TextWrapping}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"> |
|||
<TextBlock.IsVisible> |
|||
<MultiBinding Converter="{x:Static BoolConverters.And}"> |
|||
<Binding ElementName="PART_TextPresenter" Path="PreeditText" Converter="{x:Static StringConverters.IsNullOrEmpty}"/> |
|||
<Binding RelativeSource="{RelativeSource TemplatedParent}" Path="Text" Converter="{x:Static StringConverters.IsNullOrEmpty}"/> |
|||
</MultiBinding> |
|||
</TextBlock.IsVisible> |
|||
</TextBlock> |
|||
|
|||
<TextPresenter Name="PART_TextPresenter" |
|||
Text="{TemplateBinding Text, Mode=TwoWay}" |
|||
CaretBlinkInterval="{TemplateBinding CaretBlinkInterval}" |
|||
CaretIndex="{TemplateBinding CaretIndex}" |
|||
SelectionStart="{TemplateBinding SelectionStart}" |
|||
SelectionEnd="{TemplateBinding SelectionEnd}" |
|||
TextAlignment="{TemplateBinding TextAlignment}" |
|||
TextWrapping="{TemplateBinding TextWrapping}" |
|||
LineHeight="{TemplateBinding LineHeight}" |
|||
LetterSpacing="{TemplateBinding LetterSpacing}" |
|||
PasswordChar="{TemplateBinding PasswordChar}" |
|||
RevealPassword="{TemplateBinding RevealPassword}" |
|||
SelectionBrush="{TemplateBinding SelectionBrush}" |
|||
SelectionForegroundBrush="{TemplateBinding SelectionForegroundBrush}" |
|||
CaretBrush="{TemplateBinding CaretBrush}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|||
</Panel> |
|||
<ScrollViewer.Styles> |
|||
<Style Selector="ScrollContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Cursor" Value="IBeam" /> |
|||
</Style> |
|||
</ScrollViewer.Styles> |
|||
</ScrollViewer> |
|||
</DockPanel> |
|||
<ContentPresenter Grid.Column="2" |
|||
Grid.ColumnSpan="1" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding InnerRightContent}"/> |
|||
</Grid> |
|||
</Border> |
|||
</Panel> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:touch-mode"> |
|||
<Setter Property="ContextFlyout" Value="{StaticResource HorizontalTextBoxContextFlyout}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundDisabled}" /> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_BorderElement"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
</Style> |
|||
|
|||
<!-- PointerOver State--> |
|||
<Style Selector="^:pointerover"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" /> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_BorderElement"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushPointerOver}"/> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="^:focus"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" /> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_BorderElement"> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackgroundFocused}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrushFocused}"/> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThicknessFocused}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:error /template/ Border#PART_BorderElement"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ TextBlock#PART_FloatingPlaceholder"> |
|||
<Setter Property="Cursor" Value="IBeam"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^[UseFloatingPlaceholder=true]:not(:empty) /template/ TextBlock#PART_FloatingPlaceholder"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
|
|||
<Style Selector="^.revealPasswordButton[AcceptsReturn=False][IsReadOnly=False]:not(TextBox:empty)"> |
|||
<Setter Property="InnerRightContent"> |
|||
<Template> |
|||
<ToggleButton Theme="{StaticResource FluentTextBoxToggleButton}" |
|||
IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}" |
|||
ClipToBounds="True"> |
|||
<Panel> |
|||
<PathIcon Data="{StaticResource PasswordBoxRevealButtonData}" |
|||
Height="8" Width="12" |
|||
IsVisible="{Binding !$parent[ToggleButton].IsChecked}"/> |
|||
<PathIcon Data="{StaticResource PasswordBoxHideButtonData}" |
|||
Height="12" Width="12" |
|||
IsVisible="{Binding $parent[ToggleButton].IsChecked}"/> |
|||
</Panel> |
|||
</ToggleButton> |
|||
</Template> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="^.clearButton[AcceptsReturn=False][IsReadOnly=False]:focus:not(TextBox:empty)"> |
|||
<Setter Property="InnerRightContent"> |
|||
<Template> |
|||
<Button Theme="{StaticResource FluentTextBoxButton}" |
|||
Command="{Binding $parent[TextBox].Clear}" |
|||
ClipToBounds="True"> |
|||
<PathIcon Data="{StaticResource TextBoxClearButtonData}" Height="10" Width="10"/> |
|||
</Button> |
|||
</Template> |
|||
</Setter> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,118 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Grid> |
|||
<Border> |
|||
<Image Stretch="Uniform" HorizontalAlignment="Left" |
|||
Cursor="Arrow" |
|||
Name="PART_HandlePathIcon" |
|||
Height="{DynamicResource TextSelectHandleSize}" |
|||
Source="{DynamicResource TextSelectionHandleDrawing}"> |
|||
</Image> |
|||
</Border> |
|||
</Grid> |
|||
</Design.PreviewWith> |
|||
<x:Double x:Key="TextSelectHandleSize">32</x:Double> |
|||
|
|||
<DrawingImage x:Key="TextSelectionHandleDrawing"> |
|||
<DrawingImage.Drawing> |
|||
<GeometryDrawing Geometry="{DynamicResource TextSelectionHandlePath}" |
|||
Brush="{DynamicResource TextControlSelectionHighlightColor}" |
|||
> |
|||
<GeometryDrawing.Pen> |
|||
<Pen Thickness="0.5" Brush="{DynamicResource SystemControlForegroundBaseHighBrush}" LineJoin="Round"/> |
|||
</GeometryDrawing.Pen> |
|||
</GeometryDrawing> |
|||
</DrawingImage.Drawing> |
|||
</DrawingImage> |
|||
|
|||
<DrawingImage x:Key="TextCaretHandleDrawing"> |
|||
<DrawingImage.Drawing> |
|||
<GeometryDrawing Geometry="{DynamicResource TextCaretHandlePath}" |
|||
Brush="{DynamicResource TextControlSelectionHighlightColor}" |
|||
> |
|||
<GeometryDrawing.Pen> |
|||
<Pen Thickness="0.5" Brush="{DynamicResource SystemControlForegroundBaseHighBrush}" LineJoin="Round"/> |
|||
</GeometryDrawing.Pen> |
|||
</GeometryDrawing> |
|||
</DrawingImage.Drawing> |
|||
</DrawingImage> |
|||
|
|||
<GeometryGroup x:Key="TextSelectionHandlePath"> |
|||
<CombinedGeometry> |
|||
<CombinedGeometry.Geometry1> |
|||
<RectangleGeometry Rect="0,0,16,16"/> |
|||
</CombinedGeometry.Geometry1> |
|||
<CombinedGeometry.Geometry2> |
|||
<EllipseGeometry Center="16,16" |
|||
RadiusX="16" |
|||
RadiusY="16"/> |
|||
</CombinedGeometry.Geometry2> |
|||
</CombinedGeometry> |
|||
</GeometryGroup> |
|||
|
|||
<GeometryGroup x:Key="TextCaretHandlePath"> |
|||
<CombinedGeometry> |
|||
<CombinedGeometry.Geometry1> |
|||
<RectangleGeometry Rect="0,0,16,16"> |
|||
<RectangleGeometry.Transform> |
|||
<TransformGroup > |
|||
<RotateTransform CenterX="16" |
|||
Angle="-45"/> |
|||
</TransformGroup> |
|||
</RectangleGeometry.Transform> |
|||
</RectangleGeometry> |
|||
</CombinedGeometry.Geometry1> |
|||
<CombinedGeometry.Geometry2> |
|||
<EllipseGeometry Center="16,22.7" |
|||
RadiusX="16" |
|||
RadiusY="16"/> |
|||
</CombinedGeometry.Geometry2> |
|||
</CombinedGeometry> |
|||
</GeometryGroup> |
|||
<ControlTheme x:Key="{x:Type TextSelectionHandle}" |
|||
TargetType="TextSelectionHandle"> |
|||
<Setter Property="Background" |
|||
Value="{DynamicResource TextControlSelectionHighlightColor}" /> |
|||
<Setter Property="HorizontalAlignment" |
|||
Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<Setter.Value> |
|||
<ControlTemplate> |
|||
<Grid> |
|||
<Border Padding="0,0,0,10" IsHitTestVisible="True" Background="Transparent"> |
|||
<Image Stretch="Uniform" |
|||
Cursor="Arrow" |
|||
Name="PART_HandlePathIcon" |
|||
Height="{DynamicResource TextSelectHandleSize}" |
|||
Source="{DynamicResource TextSelectionHandleDrawing}"/> |
|||
</Border> |
|||
<Border Background="Transparent" |
|||
Name="PART_Indicator" |
|||
HorizontalAlignment="Center" |
|||
Width="1" |
|||
VerticalAlignment="Top" |
|||
Height="5"/> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
<Style Selector="^:caret /template/ Image#PART_HandlePathIcon"> |
|||
<Setter Property="Source" Value="{DynamicResource TextCaretHandleDrawing}" /> |
|||
</Style> |
|||
<Style Selector="^:start /template/ Image#PART_HandlePathIcon"> |
|||
<Setter Property="RenderTransform"> |
|||
<ScaleTransform ScaleX="-1" ScaleY="1"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:caret /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Center" /> |
|||
</Style> |
|||
<Style Selector="^:end /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
</Style> |
|||
<Style Selector="^:start /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,8 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type ThemeVariantScope}" |
|||
TargetType="ThemeVariantScope"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,319 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see https://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20" Height="500"> |
|||
<StackPanel Spacing="20" VerticalAlignment="Center"> |
|||
<TimePicker /> |
|||
<TimePicker CornerRadius="10" /> |
|||
<TimePicker IsEnabled="False"/> |
|||
<TimePicker> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception> |
|||
<x:Arguments> |
|||
<x:String>Error</x:String> |
|||
</x:Arguments> |
|||
</sys:Exception> |
|||
</DataValidationErrors.Error> |
|||
</TimePicker> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</x:Double> |
|||
<x:Double x:Key="TimePickerSpacerThemeWidth">1</x:Double> |
|||
<Thickness x:Key="TimePickerBorderThemeThickness">1</Thickness> |
|||
<x:Double x:Key="TimePickerFlyoutPresenterHighlightHeight">40</x:Double> |
|||
<x:Double x:Key="TimePickerFlyoutPresenterAcceptDismissHostGridHeight">41</x:Double> |
|||
<x:Double x:Key="TimePickerThemeMinWidth">242</x:Double> |
|||
<x:Double x:Key="TimePickerThemeMaxWidth">456</x:Double> |
|||
<Thickness x:Key="TimePickerFlyoutPresenterItemPadding">0,3,0,6</Thickness> |
|||
<Thickness x:Key="TimePickerHostPadding">0,3,0,6</Thickness> |
|||
|
|||
<ControlTheme x:Key="FluentTimePickerFlyoutButton" TargetType="Button"> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
CornerRadius="{TemplateBinding CornerRadius}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource TimePickerButtonBackgroundPressed}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource TimePickerButtonForegroundPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TimePickerButtonBorderBrushDisabled}"/> |
|||
<Setter Property="Background" Value="{DynamicResource TimePickerButtonBackgroundDisabled}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource TimePickerButtonForegroundDisabled}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type TimePicker}" TargetType="TimePicker"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TimePickerButtonForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TimePickerButtonBackground}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TimePickerButtonBorderBrush}"/> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TimePickerBorderThemeThickness}"/> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TimePickerThemeMinWidth}" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource TimePickerThemeMaxWidth}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Grid Name="LayoutRoot" Margin="{TemplateBinding Padding}"> |
|||
<Button x:Name="PART_FlyoutButton" |
|||
Theme="{StaticResource FluentTimePickerFlyoutButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
IsEnabled="{TemplateBinding IsEnabled}" |
|||
MinWidth="{TemplateBinding MinWidth}" |
|||
MaxWidth="{TemplateBinding MaxWidth}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
|
|||
<Grid Name="PART_FlyoutButtonContentGrid"> |
|||
<!--Ignore col defs here, set in code--> |
|||
<Border x:Name="PART_FirstPickerHost" |
|||
Grid.Column="0" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<TextBlock x:Name="PART_HourTextBlock" |
|||
Text="{DynamicResource StringTimePickerHourText}" |
|||
HorizontalAlignment="Center" |
|||
Padding="{DynamicResource TimePickerHostPadding}" /> |
|||
</Border> |
|||
|
|||
<Rectangle Name="PART_FirstColumnDivider" |
|||
Fill="{DynamicResource TimePickerSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="1" /> |
|||
|
|||
<Border x:Name="PART_SecondPickerHost" |
|||
Grid.Column="2" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<TextBlock x:Name="PART_MinuteTextBlock" |
|||
Text="{DynamicResource StringTimePickerMinuteText}" |
|||
HorizontalAlignment="Center" |
|||
Padding="{DynamicResource TimePickerHostPadding}"/> |
|||
</Border> |
|||
|
|||
<Rectangle Name="PART_SecondColumnDivider" |
|||
Fill="{DynamicResource TimePickerSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="3" /> |
|||
|
|||
<Border x:Name="PART_ThirdPickerHost" |
|||
Grid.Column="4" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<TextBlock x:Name="PART_SecondTextBlock" |
|||
Text="{DynamicResource StringTimePickerSecondText}" |
|||
HorizontalAlignment="Center" |
|||
Padding="{DynamicResource TimePickerHostPadding}"/> |
|||
</Border> |
|||
|
|||
<Rectangle Name="PART_ThirdColumnDivider" |
|||
Fill="{DynamicResource TimePickerSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="5" /> |
|||
|
|||
<Border x:Name="PART_FourthPickerHost" |
|||
Grid.Column="6" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<TextBlock x:Name="PART_PeriodTextBlock" |
|||
HorizontalAlignment="Center" |
|||
Padding="{DynamicResource TimePickerHostPadding}" /> |
|||
</Border> |
|||
</Grid> |
|||
</Button> |
|||
|
|||
<Popup Name="PART_Popup" |
|||
WindowManagerAddShadowHint="False" |
|||
IsLightDismissEnabled="True" |
|||
PlacementTarget="{TemplateBinding}" |
|||
Placement="Bottom"> |
|||
<TimePickerPresenter Name="PART_PickerPresenter" /> |
|||
</Popup> |
|||
|
|||
</Grid> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:disabled /template/ Rectangle"> |
|||
<Setter Property="Fill" Value="{DynamicResource TimePickerSpacerFillDisabled}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:hasnotime /template/ Button#PART_FlyoutButton TextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForeground}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="^:error /template/ Button#PART_FlyoutButton"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type TimePickerPresenter}" TargetType="TimePickerPresenter"> |
|||
<Setter Property="Width" Value="242" /> |
|||
<Setter Property="MinWidth" Value="242" /> |
|||
<Setter Property="MaxHeight" Value="398" /> |
|||
<Setter Property="Background" Value="{DynamicResource TimePickerFlyoutPresenterBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TimePickerFlyoutPresenterBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource DateTimeFlyoutBorderThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="Background" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{DynamicResource DateTimeFlyoutBorderPadding}" |
|||
MaxHeight="398"> |
|||
<Grid Name="ContentPanel" RowDefinitions="*,Auto"> |
|||
<Grid Name="PART_PickerContainer"> |
|||
<!--Ignore col defs here, set in code--> |
|||
<Panel Name="PART_HourHost" Grid.Column="0"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_HourSelector" |
|||
PanelType="Hour" |
|||
ShouldLoop="True" |
|||
ItemHeight="{DynamicResource TimePickerFlyoutPresenterItemHeight}"/> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_HourUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_HourDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
|
|||
<Panel Name="PART_MinuteHost" Grid.Column="2"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_MinuteSelector" |
|||
PanelType="Minute" |
|||
ShouldLoop="True" |
|||
ItemHeight="{DynamicResource TimePickerFlyoutPresenterItemHeight}"/> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_MinuteUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_MinuteDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
|
|||
<Panel Name="PART_SecondHost" Grid.Column="4"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_SecondSelector" |
|||
PanelType="Second" |
|||
ShouldLoop="True" |
|||
ItemHeight="{DynamicResource TimePickerFlyoutPresenterItemHeight}"/> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_SecondUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_SecondDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
|
|||
<Panel Name="PART_PeriodHost" Grid.Column="6"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" |
|||
VerticalScrollBarVisibility="Hidden"> |
|||
<DateTimePickerPanel Name="PART_PeriodSelector" |
|||
PanelType="TimePeriod" |
|||
ShouldLoop="False" |
|||
ItemHeight="{DynamicResource TimePickerFlyoutPresenterItemHeight}"/> |
|||
</ScrollViewer> |
|||
<RepeatButton Name="PART_PeriodUpButton" Theme="{StaticResource FluentDateTimePickerUpButton}"/> |
|||
<RepeatButton Name="PART_PeriodDownButton" Theme="{StaticResource FluentDateTimePickerDownButton}"/> |
|||
</Panel> |
|||
|
|||
<Rectangle x:Name="HighlightRect" ZIndex="-1" |
|||
Fill="{DynamicResource TimePickerFlyoutPresenterHighlightFill}" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="7" |
|||
VerticalAlignment="Center" |
|||
Height="{DynamicResource TimePickerFlyoutPresenterHighlightHeight}" /> |
|||
<Rectangle Name="PART_FirstSpacer" |
|||
Fill="{DynamicResource TimePickerFlyoutPresenterSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="1" /> |
|||
<Rectangle Name="PART_SecondSpacer" |
|||
Fill="{DynamicResource TimePickerFlyoutPresenterSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="3" /> |
|||
<Rectangle Name="PART_ThirdSpacer" |
|||
Fill="{DynamicResource TimePickerFlyoutPresenterSpacerFill}" |
|||
HorizontalAlignment="Center" |
|||
Width="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
Grid.Column="5" /> |
|||
</Grid> |
|||
|
|||
<Grid Name="AcceptDismissGrid" |
|||
Grid.Row="1" |
|||
ColumnDefinitions="*,*"> |
|||
<Rectangle Height="{DynamicResource TimePickerSpacerThemeWidth}" |
|||
VerticalAlignment="Top" |
|||
Fill="{DynamicResource TimePickerFlyoutPresenterSpacerFill}" |
|||
Grid.ColumnSpan="2"/> |
|||
<Button Name="PART_AcceptButton" |
|||
Grid.Column="0" |
|||
Theme="{StaticResource FluentDateTimePickerButton}" |
|||
Height="{DynamicResource TimePickerFlyoutPresenterAcceptDismissHostGridHeight}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<Path Stroke="{Binding $parent[Button].Foreground}" |
|||
StrokeLineCap="Round" |
|||
StrokeThickness="0.75" |
|||
Data="M0.5,8.5 5,13.5 15.5,3" /> |
|||
</Button> |
|||
<Button Name="PART_DismissButton" |
|||
Grid.Column="1" |
|||
Theme="{StaticResource FluentDateTimePickerButton}" |
|||
Height="{DynamicResource TimePickerFlyoutPresenterAcceptDismissHostGridHeight}" |
|||
FontSize="16" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch"> |
|||
<Path Stroke="{Binding $parent[Button].Foreground}" |
|||
StrokeLineCap="Round" |
|||
StrokeThickness="0.75" |
|||
Data="M2,2 14,14 M2,14 14 2" /> |
|||
</Button> |
|||
</Grid> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ Panel"> |
|||
<Style Selector="^:pointerover RepeatButton"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
</Style> |
|||
</Style> </ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,123 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<ToggleButton Content="Click Me!" /> |
|||
<ToggleButton Content="Disabled" IsEnabled="False" /> |
|||
<ToggleButton Content="Three state" IsThreeState="True" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type ToggleButton}" TargetType="ToggleButton"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackground}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForeground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ToggleButtonBorderThemeThickness}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ButtonPadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.075" /> |
|||
</Transitions> |
|||
</Setter> |
|||
|
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:indeterminate"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundIndeterminate}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushIndeterminate}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundIndeterminate}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundIndeterminatePointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushIndeterminatePointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundIndeterminatePressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushIndeterminatePressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundIndeterminateDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushIndeterminateDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundIndeterminateDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked"> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundChecked}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushChecked}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundChecked}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushCheckedPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushCheckedPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleButtonBackgroundCheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleButtonBorderBrushCheckedDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleButtonForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,266 @@ |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<StackPanel Margin="20" Width="250" Spacing="24"> |
|||
<StackPanel Spacing="12" > |
|||
<ToggleSwitch/> |
|||
<ToggleSwitch IsChecked="True" /> |
|||
<ToggleSwitch HorizontalContentAlignment="Left" |
|||
Content="Header" |
|||
OffContent="Off" |
|||
OnContent="On"/> |
|||
<ToggleSwitch Background="Yellow"/> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="ToggleSwitchTopHeaderMargin">0,0,0,6</Thickness> |
|||
<GridLength x:Key="ToggleSwitchPreContentMargin">6</GridLength> |
|||
<GridLength x:Key="ToggleSwitchPostContentMargin">6</GridLength> |
|||
<x:Double x:Key="ToggleSwitchThemeMinWidth">0</x:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type ToggleSwitch}" TargetType="ToggleSwitch"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchContentForeground}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="KnobTransitions"> |
|||
<Transitions> |
|||
<DoubleTransition |
|||
Easing="CubicEaseOut" |
|||
Property="Canvas.Left" |
|||
Duration="0:0:0.2" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Background="{TemplateBinding Background}" RowDefinitions="Auto,*"> |
|||
|
|||
<ContentPresenter |
|||
x:Name="PART_ContentPresenter" |
|||
Grid.Row="0" |
|||
VerticalAlignment="Top" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Margin="{DynamicResource ToggleSwitchTopHeaderMargin}" /> |
|||
|
|||
<Grid |
|||
Grid.Row="1" |
|||
MinWidth="{DynamicResource ToggleSwitchThemeMinWidth}" |
|||
HorizontalAlignment="Left" |
|||
VerticalAlignment="Top"> |
|||
|
|||
<Grid.RowDefinitions> |
|||
<RowDefinition Height="{DynamicResource ToggleSwitchPreContentMargin}" /> |
|||
<RowDefinition Height="Auto" /> |
|||
<RowDefinition Height="{DynamicResource ToggleSwitchPostContentMargin}" /> |
|||
</Grid.RowDefinitions> |
|||
|
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="Auto" /> |
|||
<ColumnDefinition Width="12" MaxWidth="12" /> |
|||
<ColumnDefinition Width="Auto" /> |
|||
</Grid.ColumnDefinitions> |
|||
|
|||
<Grid |
|||
x:Name="SwitchAreaGrid" |
|||
Grid.RowSpan="3" |
|||
Grid.ColumnSpan="3" |
|||
Background="{DynamicResource ToggleSwitchContainerBackground}" |
|||
Margin="0,5" |
|||
TemplatedControl.IsTemplateFocusTarget="True" /> |
|||
|
|||
<ContentPresenter |
|||
x:Name="PART_OffContentPresenter" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="2" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding OffContent}" |
|||
ContentTemplate="{TemplateBinding OffContentTemplate}" /> |
|||
|
|||
<ContentPresenter |
|||
x:Name="PART_OnContentPresenter" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="2" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding OnContent}" |
|||
ContentTemplate="{TemplateBinding OnContentTemplate}" /> |
|||
|
|||
<Border |
|||
x:Name="OuterBorder" |
|||
Grid.Row="1" |
|||
Width="40" |
|||
Height="20" |
|||
Background="{DynamicResource ToggleSwitchFillOff}" |
|||
BorderBrush="{DynamicResource ToggleSwitchStrokeOff}" |
|||
BorderThickness="{DynamicResource ToggleSwitchOuterBorderStrokeThickness}" |
|||
CornerRadius="10" /> |
|||
|
|||
<Border |
|||
x:Name="SwitchKnobBounds" |
|||
Grid.Row="1" |
|||
Width="40" |
|||
Height="20" |
|||
Background="{DynamicResource ToggleSwitchFillOn}" |
|||
BorderBrush="{DynamicResource ToggleSwitchStrokeOn}" |
|||
BorderThickness="{DynamicResource ToggleSwitchOnStrokeThickness}" |
|||
CornerRadius="10" /> |
|||
|
|||
<Canvas |
|||
x:Name="PART_SwitchKnob" |
|||
Grid.Row="1" |
|||
Width="20" |
|||
Height="20" |
|||
HorizontalAlignment="Left"> |
|||
|
|||
<Grid x:Name="PART_MovingKnobs" Width="20" Height="20"> |
|||
<Ellipse |
|||
x:Name="SwitchKnobOn" |
|||
Fill="{DynamicResource ToggleSwitchKnobFillOn}" |
|||
Width="10" |
|||
Height="10" /> |
|||
<Ellipse |
|||
x:Name="SwitchKnobOff" |
|||
Fill="{DynamicResource ToggleSwitchKnobFillOff}" |
|||
Width="10" |
|||
Height="10" /> |
|||
</Grid> |
|||
</Canvas> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="RecognizesAccessKey" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter:empty"> |
|||
<Setter Property="Margin" Value="0" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOverState --> |
|||
<Style Selector="^:pointerover /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pointerover /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- PressedState --> |
|||
<Style Selector="^:pressed /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- DisabledState --> |
|||
<Style Selector="^:disabled"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:disabled /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- CheckedState --> |
|||
<Style Selector="^:checked /template/ Border#OuterBorder"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ ContentPresenter#PART_OffContentPresenter"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:checked /template/ ContentPresenter#PART_OnContentPresenter"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<!-- UncheckedState --> |
|||
<Style Selector="^:unchecked /template/ Border#OuterBorder"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:unchecked /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:unchecked /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:unchecked /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:unchecked /template/ ContentPresenter#PART_OffContentPresenter"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:unchecked /template/ ContentPresenter#PART_OnContentPresenter"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,59 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<ToolTip Opacity="1">Text Content</ToolTip> |
|||
<ToolTip Opacity="1">Very long text content which should exceed the maximum with of the tooltip and wrap.</ToolTip> |
|||
<ToolTip Opacity="1"> |
|||
<StackPanel> |
|||
<TextBlock>Multi-line</TextBlock> |
|||
<TextBlock>Control Content</TextBlock> |
|||
</StackPanel> |
|||
</ToolTip> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<sys:Double x:Key="ToolTipContentMaxWidth">320</sys:Double> |
|||
|
|||
<ControlTheme x:Key="{x:Type ToolTip}" TargetType="ToolTip"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToolTipForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource ToolTipBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToolTipBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource ToolTipBorderThemeThickness}" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ToolTipContentThemeFontSize}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource ToolTipBorderThemePadding}" /> |
|||
<Setter Property="MaxWidth" Value="{DynamicResource ToolTipContentMaxWidth}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource OverlayCornerRadius}" /> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.15" /> |
|||
</Transitions> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Name="PART_LayoutRoot" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
Padding="{TemplateBinding Padding}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
MaxWidth="{TemplateBinding MaxWidth}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
TextBlock.LetterSpacing="{TemplateBinding LetterSpacing}" |
|||
TextBlock.TextWrapping="Wrap"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:open"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,30 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type TransitioningContentControl}" TargetType="TransitioningContentControl"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
<ContentPresenter Name="PART_ContentPresenter2" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,45 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TreeView> |
|||
<TreeViewItem Header="Root" IsExpanded="True"> |
|||
<TreeViewItem Header="Child1"/> |
|||
<TreeViewItem Header="Child2"/> |
|||
</TreeViewItem> |
|||
</TreeView> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type TreeView}" TargetType="TreeView"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderBrush" Value="Transparent" /> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" /> |
|||
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<ScrollViewer Background="{TemplateBinding Background}" |
|||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|||
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}" |
|||
BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,178 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="using:Avalonia.Controls.Converters" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Border Padding="20" |
|||
MinWidth="300"> |
|||
<TreeView> |
|||
<TreeViewItem Header="Level 1" IsExpanded="True"> |
|||
<TreeViewItem Header="Level 2.1" IsSelected="True" IsExpanded="True"> |
|||
<TreeViewItem Header="Level 3.1" /> |
|||
<TreeViewItem Header="Level 3.2" IsSelected="True"> |
|||
<TreeViewItem Header="Level 4" /> |
|||
</TreeViewItem> |
|||
</TreeViewItem> |
|||
<TreeViewItem Header="Level 2.2" IsEnabled="False" /> |
|||
</TreeViewItem> |
|||
</TreeView> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="TreeViewItemIndent">16</x:Double> |
|||
<x:Double x:Key="TreeViewItemExpandCollapseChevronSize">12</x:Double> |
|||
<Thickness x:Key="TreeViewItemExpandCollapseChevronMargin">12, 0, 12, 0</Thickness> |
|||
<StreamGeometry x:Key="TreeViewItemCollapsedChevronPathData">M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z</StreamGeometry> |
|||
<StreamGeometry x:Key="TreeViewItemExpandedChevronPathData">M0,1 L10,10 20,1 19,0 10,8 1,0 Z</StreamGeometry> |
|||
|
|||
<ControlTheme x:Key="FluentTreeViewExpandCollapseChevron" TargetType="ToggleButton"> |
|||
<Setter Property="Margin" Value="0" /> |
|||
<Setter Property="Width" Value="{StaticResource TreeViewItemExpandCollapseChevronSize}" /> |
|||
<Setter Property="Height" Value="{StaticResource TreeViewItemExpandCollapseChevronSize}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="Transparent" |
|||
Width="{TemplateBinding Width}" |
|||
Height="{TemplateBinding Height}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center"> |
|||
<Path x:Name="ChevronPath" |
|||
Data="{StaticResource TreeViewItemCollapsedChevronPathData}" |
|||
Fill="{DynamicResource TreeViewItemForeground}" |
|||
Stretch="Uniform" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:checked /template/ Path#ChevronPath"> |
|||
<Setter Property="Data" Value="{StaticResource TreeViewItemExpandedChevronPathData}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type TreeViewItem}" TargetType="TreeViewItem"> |
|||
<Setter Property="Padding" Value="0" /> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrush}" /> |
|||
<Setter Property="BorderThickness" Value="{DynamicResource TreeViewItemBorderThemeThickness}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForeground}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TreeViewItemMinHeight}" /> |
|||
<Setter Property="VerticalAlignment" Value="Center" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel> |
|||
<Border Name="PART_LayoutRoot" |
|||
Classes="TreeViewItemLayoutRoot" |
|||
Focusable="True" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
MinHeight="{TemplateBinding MinHeight}" |
|||
TemplatedControl.IsTemplateFocusTarget="True"> |
|||
<Grid Name="PART_Header" |
|||
ColumnDefinitions="Auto, *"> |
|||
<Grid.Margin> |
|||
<MultiBinding Converter="{x:Static converters:TreeViewItemIndentConverter.Instance}"> |
|||
<Binding Path="Level" RelativeSource="{RelativeSource TemplatedParent}" /> |
|||
<DynamicResource ResourceKey="TreeViewItemIndent" /> |
|||
</MultiBinding> |
|||
</Grid.Margin> |
|||
<Panel Name="PART_ExpandCollapseChevronContainer" |
|||
Margin="{StaticResource TreeViewItemExpandCollapseChevronMargin}"> |
|||
<ToggleButton Name="PART_ExpandCollapseChevron" |
|||
Theme="{StaticResource FluentTreeViewExpandCollapseChevron}" |
|||
Focusable="False" |
|||
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
|||
</Panel> |
|||
<ContentPresenter Name="PART_HeaderPresenter" |
|||
Grid.Column="1" |
|||
Focusable="False" |
|||
Background="Transparent" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalAlignment}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</Grid> |
|||
</Border> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
IsVisible="{TemplateBinding IsExpanded}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" /> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed state --> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled state --> |
|||
<Style Selector="^:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<Style Selector="^:selected /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundSelected}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushSelected}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Border#PART_LayoutRoot > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelected}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected PointerOver state --> |
|||
<Style Selector="^:selected /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushSelectedPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:selected /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Pressed state --> |
|||
<Style Selector="^:pressed:selected /template/ Border#PART_LayoutRoot:pointerover"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundSelectedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushSelectedPressed}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed:selected /template/ Border#PART_LayoutRoot:pointerover > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled Selected state --> |
|||
<Style Selector="^:disabled:selected /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TreeViewItemBackgroundSelectedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TreeViewItemBorderBrushSelectedDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled:selected /template/ Border#PART_LayoutRoot > ContentPresenter#PART_HeaderPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TreeViewItemForegroundSelectedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:empty /template/ ToggleButton#PART_ExpandCollapseChevron"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:empty /template/ Panel#PART_ExpandCollapseChevronContainer"> |
|||
<Setter Property="Width" Value="{StaticResource TreeViewItemExpandCollapseChevronSize}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,29 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type Window}" TargetType="Window"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemRegionBrush}"/> |
|||
<Setter Property="TransparencyBackgroundFallback" Value="{DynamicResource SystemControlBackgroundAltHighBrush}" /> |
|||
<Setter Property="TopLevel.SystemBarColor" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<Border Background="{TemplateBinding Background}" IsHitTestVisible="False" /> |
|||
<Panel Background="Transparent" Margin="{TemplateBinding WindowDecorationMargin}" /> |
|||
<VisualLayerManager Name="PART_VisualLayerManager"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|||
</VisualLayerManager> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,224 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
|
|||
<x:Double x:Key="CaptionButtonWidth">45</x:Double> |
|||
<x:Double x:Key="CaptionButtonHeight">30</x:Double> |
|||
|
|||
<ControlTheme x:Key="FluentDrawnCaptionButton" TargetType="Button"> |
|||
<Setter Property="Background" Value="{DynamicResource CaptionButtonBackground}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CaptionButtonBorderBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CaptionButtonForeground}"/> |
|||
<Setter Property="Width" Value="{DynamicResource CaptionButtonWidth}"/> |
|||
<Setter Property="Height" Value="{DynamicResource CaptionButtonHeight}"/> |
|||
<Setter Property="VerticalAlignment" Value="Stretch"/> |
|||
<Setter Property="(WindowDecorationProperties.ElementRole)" Value="DecorationsElement"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="Transparent" |
|||
Content="{TemplateBinding Content}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:pointerover /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{TemplateBinding Background}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{TemplateBinding BorderBrush}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<ControlTheme x:Key="{x:Type WindowDrawnDecorations}" TargetType="WindowDrawnDecorations"> |
|||
<Setter Property="DefaultTitleBarHeight" Value="30"/> |
|||
<Setter Property="DefaultFrameThickness" Value="1"/> |
|||
<Setter Property="DefaultShadowThickness" Value="8"/> |
|||
<Setter Property="Template"> |
|||
<WindowDrawnDecorationsTemplate> |
|||
<WindowDrawnDecorationsContent> |
|||
|
|||
<WindowDrawnDecorationsContent.Underlay> |
|||
<Panel x:Name="PART_UnderlayWrapper"> |
|||
<Border x:Name="PART_WindowBorder" |
|||
Background="{DynamicResource SystemControlTransparentBrush}" |
|||
BorderThickness="{TemplateBinding FrameThickness}" |
|||
BorderBrush="{DynamicResource SystemControlForegroundBaseMediumBrush}" |
|||
IsHitTestVisible="False" /> |
|||
<!-- Titlebar: background, title text, and drag area live in underlay --> |
|||
<Panel x:Name="PART_TitleBar" VerticalAlignment="Top" |
|||
Height="{TemplateBinding TitleBarHeight}" |
|||
Background="{DynamicResource TitleBarBackgroundBrush}" |
|||
IsVisible="{TemplateBinding HasTitleBar}" |
|||
WindowDecorationProperties.ElementRole="TitleBar" /> |
|||
|
|||
</Panel> |
|||
</WindowDrawnDecorationsContent.Underlay> |
|||
|
|||
<WindowDrawnDecorationsContent.Overlay> |
|||
<!-- Overlay: only interactive caption buttons --> |
|||
<Panel x:Name="PART_OverlayWrapper"> |
|||
<!-- Title text lives in overlay so it renders above client content --> |
|||
<Panel x:Name="PART_TitleTextPanel" VerticalAlignment="Top" |
|||
Height="{TemplateBinding TitleBarHeight}" |
|||
IsHitTestVisible="False" |
|||
IsVisible="{TemplateBinding HasTitleBar}"> |
|||
<TextBlock Text="{TemplateBinding Title}" |
|||
VerticalAlignment="Center" |
|||
Margin="12,0,0,0" |
|||
FontSize="12" /> |
|||
</Panel> |
|||
<StackPanel x:Name="PART_OverlayPanel" |
|||
VerticalAlignment="Top" |
|||
HorizontalAlignment="Right" |
|||
Height="{TemplateBinding TitleBarHeight}" |
|||
IsVisible="{TemplateBinding HasTitleBar}" |
|||
Orientation="Horizontal" |
|||
Spacing="2" |
|||
TextElement.FontSize="10"> |
|||
<Button x:Name="PART_FullScreenButton" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="FullScreenButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Name="FullScreenButtonPath" |
|||
Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M2048 2048v-819h-205v469l-1493 -1493h469v-205h-819v819h205v-469l1493 1493h-469v205h819z" /> |
|||
</Viewbox> |
|||
</Button> |
|||
<Button x:Name="PART_MinimizeButton" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="MinimizeButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M2048 1229v-205h-2048v205h2048z" /> |
|||
</Viewbox> |
|||
</Button> |
|||
<Button x:Name="PART_MaximizeButton" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="MaximizeButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Viewbox.RenderTransform> |
|||
<RotateTransform Angle="-90" /> |
|||
</Viewbox.RenderTransform> |
|||
<Path Name="RestoreButtonPath" |
|||
Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M2048 2048v-2048h-2048v2048h2048zM1843 1843h-1638v-1638h1638v1638z"/> |
|||
</Viewbox> |
|||
</Button> |
|||
<Button x:Name="PART_CloseButton" |
|||
Background="#ffe81123" |
|||
BorderBrush="#fff1707a" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="CloseButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M1169 1024l879 -879l-145 -145l-879 879l-879 -879l-145 145l879 879l-879 879l145 145l879 -879l879 879l145 -145z" /> |
|||
</Viewbox> |
|||
</Button> |
|||
</StackPanel> |
|||
</Panel> |
|||
</WindowDrawnDecorationsContent.Overlay> |
|||
|
|||
<WindowDrawnDecorationsContent.FullscreenPopover> |
|||
<Panel Height="{TemplateBinding DefaultTitleBarHeight}" |
|||
VerticalAlignment="Top" |
|||
Background="{DynamicResource SystemControlBackgroundChromeMediumLowBrush}" |
|||
WindowDecorationProperties.ElementRole="TitleBar"> |
|||
<TextBlock Text="{TemplateBinding Title}" |
|||
VerticalAlignment="Center" |
|||
Margin="12,0,0,0" |
|||
FontSize="12" /> |
|||
<StackPanel HorizontalAlignment="Right" |
|||
Orientation="Horizontal" |
|||
Spacing="2" |
|||
TextElement.FontSize="10"> |
|||
<Button x:Name="PART_PopoverFullScreenButton" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="FullScreenButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M205 1024h819v-819h-205v469l-674 -674l-145 145l674 674h-469v205zM1374 1229h469v-205h-819v819h205v-469l674 674l145 -145z" /> |
|||
</Viewbox> |
|||
</Button> |
|||
<Button x:Name="PART_PopoverCloseButton" |
|||
Background="#ffe81123" |
|||
BorderBrush="#fff1707a" |
|||
Theme="{StaticResource FluentDrawnCaptionButton}" |
|||
WindowDecorationProperties.ElementRole="CloseButton"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" |
|||
Fill="{DynamicResource CaptionButtonForeground}" |
|||
Data="M1169 1024l879 -879l-145 -145l-879 879l-879 -879l-145 145l879 879l-879 879l145 145l879 -879l879 879l145 -145z" /> |
|||
</Viewbox> |
|||
</Button> |
|||
</StackPanel> |
|||
</Panel> |
|||
</WindowDrawnDecorationsContent.FullscreenPopover> |
|||
|
|||
</WindowDrawnDecorationsContent> |
|||
</WindowDrawnDecorationsTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Shadow: inset border and add drop shadow --> |
|||
<Style Selector="^:has-shadow /template/ Panel#PART_UnderlayWrapper"> |
|||
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}"/> |
|||
</Style> |
|||
<Style Selector="^:has-shadow /template/ Border#PART_WindowBorder"> |
|||
<Setter Property="BoxShadow" Value="0 2 10 2 #80000000"/> |
|||
</Style> |
|||
<Style Selector="^:has-shadow /template/ Panel#PART_OverlayWrapper"> |
|||
<Setter Property="Margin" Value="{TemplateBinding ShadowThickness}"/> |
|||
</Style> |
|||
|
|||
<!-- Border: inset titlebar and buttons inside frame --> |
|||
<Style Selector="^:has-border /template/ Panel#PART_TitleTextPanel"> |
|||
<Setter Property="Margin" Value="1,1,1,0"/> |
|||
</Style> |
|||
<Style Selector="^:has-border /template/ Panel#PART_TitleBar"> |
|||
<Setter Property="Margin" Value="1,1,1,0"/> |
|||
</Style> |
|||
<Style Selector="^:has-border /template/ StackPanel#PART_OverlayPanel"> |
|||
<Setter Property="Margin" Value="0,1,1,0"/> |
|||
</Style> |
|||
|
|||
<!-- Maximized: restore button path changes --> |
|||
<Style Selector="^:maximized /template/ Path#RestoreButtonPath"> |
|||
<Setter Property="Data" Value="M2048 410h-410v-410h-1638v1638h410v410h1638v-1638zM1434 1434h-1229v-1229h1229v1229zM1843 1843h-1229v-205h1024v-1024h205v1229z" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled buttons --> |
|||
<Style Selector="^ /template/ Button:disabled"> |
|||
<Setter Property="Opacity" Value="0.2"/> |
|||
</Style> |
|||
|
|||
<!-- Hide caption buttons when the platform does not support the action --> |
|||
<Style Selector="^:not(:has-minimize) /template/ Button#PART_MinimizeButton"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</Style> |
|||
<Style Selector="^:not(:has-maximize) /template/ Button#PART_MaximizeButton"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</Style> |
|||
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_FullScreenButton"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</Style> |
|||
<Style Selector="^:not(:has-fullscreen) /template/ Button#PART_PopoverFullScreenButton"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</Style> |
|||
|
|||
<!-- Fullscreen: hide overlay and titlebar (popover takes over) --> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_TitleTextPanel"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ StackPanel#PART_OverlayPanel"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_TitleBar"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,68 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:DataType="WindowNotificationManager" |
|||
x:ClassModifier="internal"> |
|||
<ControlTheme x:Key="{x:Type WindowNotificationManager}" TargetType="WindowNotificationManager"> |
|||
<Setter Property="Margin" Value="0 0" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ReversibleStackPanel Name="PART_Items"> |
|||
<ReversibleStackPanel.DataTemplates> |
|||
<DataTemplate DataType="INotification"> |
|||
<StackPanel |
|||
Margin="12" |
|||
Spacing="8" |
|||
TextElement.Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"> |
|||
<TextBlock FontWeight="Medium" Text="{Binding Title}" /> |
|||
<TextBlock |
|||
MaxHeight="80" |
|||
Margin="0,0,12,0" |
|||
Text="{Binding Message}" |
|||
TextWrapping="Wrap" /> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
<DataTemplate DataType="x:String"> |
|||
<TextBlock |
|||
Margin="12" |
|||
Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" |
|||
Text="{Binding}" /> |
|||
</DataTemplate> |
|||
</ReversibleStackPanel.DataTemplates> |
|||
</ReversibleStackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^:topleft /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:topright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:topcenter /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Center" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:bottomleft /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:bottomright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:bottomcenter /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
<Setter Property="HorizontalAlignment" Value="Center" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,26 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<x:Double x:Key="ControlContentThemeFontSize">14</x:Double> |
|||
<x:Double x:Key="TextControlThemeMinHeight">24</x:Double> |
|||
<x:Double x:Key="TextControlThemeMinWidth">32</x:Double> |
|||
<Thickness x:Key="TextControlThemePadding">4, 2</Thickness> |
|||
<Thickness x:Key="ListBoxItemPadding">4,2</Thickness> |
|||
<x:Double x:Key="ListViewItemMinHeight">24</x:Double> |
|||
<Thickness x:Key="ComboBoxItemThemePadding">11,5,11,7</Thickness> |
|||
<Thickness x:Key="MenuFlyoutItemThemePaddingNarrow">4 4 8 4</Thickness> |
|||
<Thickness x:Key="MenuBarItemPadding">5, 2</Thickness> |
|||
<x:Double x:Key="TreeViewItemMinHeight">24</x:Double> |
|||
<Thickness x:Key="TimePickerHostPadding">0,1,0,2</Thickness> |
|||
<Thickness x:Key="DatePickerHostPadding">0,1,0,2</Thickness> |
|||
<Thickness x:Key="DatePickerHostMonthPadding">9,0,0,1</Thickness> |
|||
<Thickness x:Key="ComboBoxEditableTextPadding">10,0,30,0</Thickness> |
|||
<x:Double x:Key="ComboBoxMinHeight">24</x:Double> |
|||
<Thickness x:Key="ComboBoxPadding">12,1,0,3</Thickness> |
|||
<x:Double x:Key="NavigationViewItemOnLeftMinHeight">32</x:Double> |
|||
<x:Double x:Key="TabItemMinHeight">28</x:Double> |
|||
<Thickness x:Key="TabItemHeaderMargin">6, 0</Thickness> |
|||
<Thickness x:Key="ButtonPadding">6,4</Thickness> |
|||
<x:Double x:Key="CheckBoxMinHeight">24</x:Double> |
|||
<x:Double x:Key="RadioButtonMinHeight">24</x:Double> |
|||
</ResourceDictionary> |
|||
@ -0,0 +1,27 @@ |
|||
<Styles x:Class="Avalonia.Themes.Fluent2.Fluent2Theme" |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:fluent="using:Avalonia.Themes.Fluent2" |
|||
xmlns:accents="using:Avalonia.Themes.Fluent2.Accents"> |
|||
<Styles.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<!-- Keep custom palettes higher priority than default BaseColorsPalette and SystemAccentColors |
|||
As that's an only place for user to redefine palette in a good way --> |
|||
<ResourceInclude Source="/Accents/BaseColorsPalette.xaml" /> |
|||
<accents:SystemAccentColors /> |
|||
<fluent:ColorPaletteResourcesCollection /> |
|||
|
|||
<!-- Resources and brushes will be merged into current dictionary for slightly better performance and possible optimizations --> |
|||
<MergeResourceInclude Source="/Accents/BaseResources.xaml" /> |
|||
<MergeResourceInclude Source="/Accents/FluentControlResources.xaml" /> |
|||
<MergeResourceInclude Source="/Strings/InvariantResources.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
|
|||
<!-- These are not part of MergedDictionaries so we can add or remove them easier --> |
|||
<ResourceInclude x:Key="CompactStyles" Source="/DensityStyles/Compact.xaml" /> |
|||
</ResourceDictionary> |
|||
</Styles.Resources> |
|||
|
|||
<StyleInclude Source="/Controls/FluentControls.xaml" /> |
|||
</Styles> |
|||
@ -0,0 +1,82 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Avalonia.Controls; |
|||
using Avalonia.Markup.Xaml; |
|||
using Avalonia.Styling; |
|||
|
|||
namespace Avalonia.Themes.Fluent2 |
|||
{ |
|||
public enum DensityStyle |
|||
{ |
|||
Normal, |
|||
Compact |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// Includes the fluent theme in an application.
|
|||
/// </summary>
|
|||
public class Fluent2Theme : Styles, IResourceNode |
|||
{ |
|||
private readonly ResourceDictionary _compactStyles; |
|||
private DensityStyle _densityStyle; |
|||
|
|||
/// <summary>
|
|||
/// Initializes a new instance of the <see cref="Fluent2Theme"/> class.
|
|||
/// </summary>
|
|||
/// <param name="sp">The parent's service provider.</param>
|
|||
public Fluent2Theme(IServiceProvider? sp = null) |
|||
{ |
|||
AvaloniaXamlLoader.Load(sp, this); |
|||
|
|||
_compactStyles = (ResourceDictionary)GetAndRemove("CompactStyles"); |
|||
|
|||
Palettes = Resources.MergedDictionaries.OfType<ColorPaletteResourcesCollection>().FirstOrDefault() |
|||
?? throw new InvalidOperationException("Fluent2Theme was initialized with missing ColorPaletteResourcesCollection."); |
|||
|
|||
object GetAndRemove(string key) |
|||
{ |
|||
var val = Resources[key] |
|||
?? throw new KeyNotFoundException($"Key {key} was not found in the resources"); |
|||
Resources.Remove(key); |
|||
return val; |
|||
} |
|||
} |
|||
|
|||
public static readonly DirectProperty<Fluent2Theme, DensityStyle> DensityStyleProperty = AvaloniaProperty.RegisterDirect<Fluent2Theme, DensityStyle>( |
|||
nameof(DensityStyle), o => o.DensityStyle, (o, v) => o.DensityStyle = v); |
|||
|
|||
/// <summary>
|
|||
/// Gets or sets the density style of the fluent theme (normal, compact).
|
|||
/// </summary>
|
|||
public DensityStyle DensityStyle |
|||
{ |
|||
get => _densityStyle; |
|||
set => SetAndRaise(DensityStyleProperty, ref _densityStyle, value); |
|||
} |
|||
|
|||
public IDictionary<ThemeVariant, ColorPaletteResources> Palettes { get; } |
|||
|
|||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change) |
|||
{ |
|||
base.OnPropertyChanged(change); |
|||
|
|||
if (change.Property == DensityStyleProperty) |
|||
{ |
|||
Owner?.NotifyHostedResourcesChanged(ResourcesChangedEventArgs.Create()); |
|||
} |
|||
} |
|||
|
|||
bool IResourceNode.TryGetResource(object key, ThemeVariant? theme, out object? value) |
|||
{ |
|||
// DensityStyle dictionary should be checked first
|
|||
if (_densityStyle == DensityStyle.Compact |
|||
&& _compactStyles.TryGetResource(key, theme, out value)) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
return base.TryGetResource(key, theme, out value); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
using Avalonia.Metadata; |
|||
|
|||
[assembly: XmlnsDefinition("https://github.com/avaloniaui", "Avalonia.Themes.Fluent2")] |
|||
@ -0,0 +1,29 @@ |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:ClassModifier="internal"> |
|||
<!-- DatePicker --> |
|||
<x:String x:Key="StringDatePickerDayText">day</x:String> |
|||
<x:String x:Key="StringDatePickerMonthText">month</x:String> |
|||
<x:String x:Key="StringDatePickerYearText">year</x:String> |
|||
<!-- TimePicker --> |
|||
<x:String x:Key="StringTimePickerHourText">hour</x:String> |
|||
<x:String x:Key="StringTimePickerMinuteText">minute</x:String> |
|||
<x:String x:Key="StringTimePickerSecondText">second</x:String> |
|||
<!-- TextBox/SelectableTextBox flyout --> |
|||
<x:String x:Key="StringTextFlyoutCutText">Cut</x:String> |
|||
<x:String x:Key="StringTextFlyoutCopyText">Copy</x:String> |
|||
<x:String x:Key="StringTextFlyoutPasteText">Paste</x:String> |
|||
<!-- ManagedFileChooser --> |
|||
<x:String x:Key="StringManagedFileChooserFileNamePlaceholder">File name</x:String> |
|||
<x:String x:Key="StringManagedFileChooserShowHiddenFilesText">Show hidden files</x:String> |
|||
<x:String x:Key="StringManagedFileChooserOkText">OK</x:String> |
|||
<x:String x:Key="StringManagedFileChooserCancelText">Cancel</x:String> |
|||
<x:String x:Key="StringManagedFileChooserNameColumn">Name</x:String> |
|||
<x:String x:Key="StringManagedFileChooserDateModifiedColumn">Date Modified</x:String> |
|||
<x:String x:Key="StringManagedFileChooserTypeColumn">Type</x:String> |
|||
<x:String x:Key="StringManagedFileChooserSizeColumn">Size</x:String> |
|||
<x:String x:Key="StringManagedFileChooserOverwritePromptFileAlreadyExistsText">{0} already exists. Do you want to replace it?</x:String> |
|||
<x:String x:Key="StringManagedFileChooserOverwritePromptConfirmText">Yes</x:String> |
|||
<x:String x:Key="StringManagedFileChooserOverwritePromptCancelText">No</x:String> |
|||
</ResourceDictionary> |
|||
|
|||
Loading…
Reference in new issue