65 changed files with 4976 additions and 5102 deletions
@ -1,38 +1,40 @@ |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<Design.PreviewWith> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Calendar /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="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="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel Name="Root" |
|||
|
|||
<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="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel |
|||
Name="Root" |
|||
HorizontalAlignment="Center" |
|||
ClipToBounds="True"> |
|||
|
|||
<CalendarItem Name="CalendarItem" |
|||
<CalendarItem |
|||
Name="CalendarItem" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
HeaderBackground="{TemplateBinding HeaderBackground}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"/> |
|||
|
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
HeaderBackground="{TemplateBinding HeaderBackground}" /> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,121 +1,109 @@ |
|||
<!-- |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see http://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"> |
|||
<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="FontSize" Value="20" /> |
|||
<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"> |
|||
<ContentControl Name="Content" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
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> |
|||
|
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<Style Selector="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="FontSize" Value="20"/> |
|||
<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"> |
|||
<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> |
|||
|
|||
<ContentControl Name="Content" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
<!-- 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> |
|||
|
|||
</Border> |
|||
<Style Selector="^ /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}" /> |
|||
<Setter Property="FontWeight" Value="SemiBold" /> |
|||
</Style> |
|||
|
|||
<!-- Drawn Border should render on top of background to preserve the 1px |
|||
margin between items--> |
|||
<Border Name="Border" |
|||
BorderThickness="2" |
|||
BorderBrush="{TemplateBinding BorderBrush}"/> |
|||
<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> |
|||
|
|||
<!--Removed for now...WinUI doesn't have selection follow focus, and only uses |
|||
focus visual w/ keyboard focus |
|||
<Border Name="FocusVisual" BorderThickness="2" |
|||
BorderBrush="{DynamicResource SystemControlHighlightBaseHighBrush}" |
|||
IsHitTestVisible="False" |
|||
Margin="-2" CornerRadius="{DynamicResource ControlCornerRadius}"/>--> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<!--<Style Selector="CalendarButton /template/ Border#FocusVisual"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</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> |
|||
|
|||
<Style Selector="CalendarButton:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewHoverBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarButton:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewPressedBorderBrush}"/> |
|||
</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/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}"/> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Adjusted :selected to look like :today from DayItem --> |
|||
<Style Selector="CalendarButton:selected /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}"/> |
|||
</Style> |
|||
<Style Selector="CalendarButton:selected /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarButton:selected:pointerover /template/ Border#Root"> |
|||
<Setter Property="Background"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColor}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarButton:selected:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColorDark1}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarButton:selected:pressed /template/ Border#Root"> |
|||
<Setter Property="Background"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColor}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarButton:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColorDark2}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:blackout /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarButton:selected /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}"/> |
|||
<Setter Property="FontWeight" Value="SemiBold"/> |
|||
</Style> |
|||
|
|||
<!-- WinUI calls this OutOfFocus --> |
|||
<Style Selector="CalendarButton:inactive /template/ Border#Root"> |
|||
<!-- These are probably set in code, but consistent --> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewOutOfScopeBackground}"/> |
|||
</Style> |
|||
<Style Selector="CalendarButton:inactive /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarButton:blackout /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}"/> |
|||
</Style> |
|||
|
|||
<!--<Style Selector="CalendarButton:dayfocused /template/ Border#FocusVisual"> |
|||
<Setter Property="IsVisible" Value="True"/> |
|||
</Style>--> |
|||
|
|||
<Style Selector="CalendarDayButton:disabled /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}"/> |
|||
</Style> |
|||
</Styles> |
|||
<Style Selector="^:disabled /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,182 +1,180 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Margin="20, 20, 20, 200"> |
|||
<CalendarDatePicker Width="200" |
|||
VerticalContentAlignment="Center" |
|||
HorizontalContentAlignment="Center" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Styles.Resources> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|||
x:CompileBindings="True"> |
|||
<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> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="CalendarDatePicker"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackground}"/> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarDatePickerForeground}"/> |
|||
<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}" |
|||
Watermark="{TemplateBinding Watermark}" |
|||
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}" |
|||
HorizontalAlignment="Stretch" |
|||
VerticalAlignment="Stretch" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Grid.Column="0" /> |
|||
<Button Name="PART_Button" |
|||
Grid.Column="1" |
|||
Focusable="False" /> |
|||
<Popup Name="PART_Popup" |
|||
PlacementTarget="{TemplateBinding}" |
|||
IsLightDismissEnabled="True"> |
|||
<Calendar Name="PART_Calendar" |
|||
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}" |
|||
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}" |
|||
SelectedDate="{TemplateBinding SelectedDate, Mode=TwoWay}" |
|||
DisplayDate="{TemplateBinding DisplayDate}" |
|||
DisplayDateStart="{TemplateBinding DisplayDateStart}" |
|||
DisplayDateEnd="{TemplateBinding DisplayDateEnd}" /> |
|||
</Popup> |
|||
</Grid> |
|||
</Panel> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- Normal State --> |
|||
<Style Selector="CalendarDatePicker /template/ Button#PART_Button"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerCalendarGlyphForeground}" /> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="BorderThickness" Value="0" /> |
|||
<Setter Property="Margin" Value="2,0,4,0" /> |
|||
<Setter Property="Padding" Value="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" |
|||
<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" |
|||
HorizontalAlignment="Center" |
|||
Grid.Column="0" |
|||
Grid.Row="1" |
|||
Fill="{TemplateBinding Foreground}" |
|||
StrokeThickness="0" |
|||
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> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="CalendarDatePicker:pressed /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushPressed}" /> |
|||
</Style> |
|||
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="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}" |
|||
Watermark="{TemplateBinding Watermark}" |
|||
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}" |
|||
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 /template/"> |
|||
<Style Selector="^ 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="^ TextBlock#PART_Watermark, ^ TextBlock#PART_FloatingWatermark"> |
|||
<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="{TemplateBinding 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> |
|||
|
|||
<!-- Pointer-over State --> |
|||
<Style Selector="CalendarDatePicker:pointerover /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushPointerOver}" /> |
|||
</Style> |
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled /template/"> |
|||
<Style Selector="^ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Button#PART_Button"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerCalendarGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="CalendarDatePicker:disabled /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarDatePickerBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrushDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarDatePicker:disabled /template/ Button#PART_Button"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerCalendarGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarDatePicker:disabled /template/ TextBox#PART_TextBox:disabled /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="CalendarDatePicker:disabled /template/ TextBox#PART_TextBox:disabled /template/ TextBlock#PART_Watermark, |
|||
CalendarDatePicker:disabled /template/ TextBox#PART_TextBox:disabled /template/ TextBlock#PART_FloatingWatermark"> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource CalendarDatePickerTextForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="CalendarDatePicker: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> |
|||
|
|||
<Style Selector="CalendarDatePicker /template/ 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> |
|||
|
|||
<!-- Error State --> |
|||
<Style Selector="CalendarDatePicker:error /template/ Border#Background"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|||
</Style> |
|||
</Styles> |
|||
<!-- 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> |
|||
|
|||
@ -1,116 +1,104 @@ |
|||
<!-- |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see http://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"> |
|||
<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="FontSize" Value="20" /> |
|||
<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"> |
|||
|
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<Style Selector="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="FontSize" Value="20"/> |
|||
<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"> |
|||
<ContentControl Name="Content" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
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> |
|||
|
|||
<ContentControl Name="Content" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
<Style Selector="^:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewHoverBorderBrush}" /> |
|||
</Style> |
|||
|
|||
</Border> |
|||
<Style Selector="^:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewPressedBorderBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Drawn Border should render on top of background to preserve the 1px |
|||
margin between items--> |
|||
<Border Name="Border" |
|||
BorderThickness="2" |
|||
BorderBrush="{TemplateBinding BorderBrush}"/> |
|||
<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> |
|||
|
|||
<!--Removed for now...WinUI doesn't have selection follow focus, and only uses |
|||
focus visual w/ keyboard focus |
|||
<Border Name="FocusVisual" BorderThickness="2" |
|||
BorderBrush="{DynamicResource SystemControlHighlightBaseHighBrush}" |
|||
IsHitTestVisible="False" |
|||
Margin="-2" CornerRadius="2"/>--> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<!--<Style Selector="CalendarDayButton /template/ Border#FocusVisual"> |
|||
<Setter Property="IsVisible" Value="False"/> |
|||
</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="^ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}" /> |
|||
<Setter Property="FontWeight" Value="SemiBold" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarDayButton:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewHoverBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewPressedBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:selected /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:selected:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedHoverBorderBrush}"/> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:selected:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewSelectedPressedBorderBrush}"/> |
|||
</Style> |
|||
<!-- WinUI calls this OutOfFocus --> |
|||
<Style Selector="^:inactive /template/"> |
|||
<Style Selector="^ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewOutOfScopeBackground}" /> |
|||
</Style> |
|||
<Style Selector="^ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarDayButton:today /template/ Border#Root"> |
|||
<!-- These are probably set in code, but consistent --> |
|||
<Setter Property="Background"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColor}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:today:pointerover /template/ Border#Border"> |
|||
<Setter Property="BorderBrush"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColorDark1}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:today:pressed /template/ Border#Border"> |
|||
<Setter Property="BorderBrush"> |
|||
<SolidColorBrush Color="{DynamicResource SystemAccentColorDark2}"/> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:today /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewTodayForeground}"/> |
|||
<Setter Property="FontWeight" Value="SemiBold"/> |
|||
</Style> |
|||
<Style Selector="^:blackout /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}" /> |
|||
</Style> |
|||
|
|||
<!-- WinUI calls this OutOfFocus --> |
|||
<Style Selector="CalendarDayButton:inactive /template/ Border#Root"> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewOutOfScopeBackground}"/> |
|||
</Style> |
|||
<Style Selector="CalendarDayButton:inactive /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewOutOfScopeForeground}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="CalendarDayButton:blackout /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewBlackoutForeground}"/> |
|||
</Style> |
|||
|
|||
<!--<Style Selector="CalendarDayButton:dayfocused /template/ Border#FocusVisual"> |
|||
<Setter Property="IsVisible" Value="True"/> |
|||
</Style>--> |
|||
<Style Selector="CalendarDayButton:disabled /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}"/> |
|||
</Style> |
|||
</Styles> |
|||
<Style Selector="^:disabled /template/ ContentControl#Content"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,143 +1,150 @@ |
|||
<!-- |
|||
<!-- |
|||
// (c) Copyright Microsoft Corporation. |
|||
// This source is subject to the Microsoft Public License (Ms-PL). |
|||
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details. |
|||
// All other rights reserved. |
|||
--> |
|||
|
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True" |
|||
x:DataType="CalendarItem"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Calendar /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="CalendarItem"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="DayTitleTemplate"> |
|||
<Template> |
|||
<TextBlock Text="{Binding}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
FontSize="12"/> |
|||
</Template> |
|||
</Setter> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border BorderThickness="{TemplateBinding BorderThickness}" |
|||
Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Border.Styles> |
|||
<Style Selector="Button.CalendarHeader"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="FontSize" Value="20" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<!-- HCA was changed here to ensure nav arrows display correctly --> |
|||
<ContentPresenter Name="Text" Background="{TemplateBinding Background}" |
|||
BorderBrush="{DynamicResource CalendarViewNavigationButtonBorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="Button.CalendarNavigation > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewForeground}"/> |
|||
</Style> |
|||
<Style Selector="Button.CalendarNavigation:pointerover > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}"/> |
|||
</Style> |
|||
<Style Selector="Button.CalendarNavigation:pressed > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewNavigationButtonForegroundPressed}"/> |
|||
</Style> |
|||
<Style Selector="Button.CalendarHeader:pointerover /template/ ContentPresenter#Text"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewNavigationButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}"/> |
|||
<!-- Prevent base button template:pointerover from overriding background here --> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}"/> |
|||
</Style> |
|||
<Style Selector="Button.CalendarHeader:pressed /template/ ContentPresenter#Text"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewNavigationButtonForegroundPressed}"/> |
|||
<!-- Prevent base button template:pointerover from overriding background here --> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}"/> |
|||
</Style> |
|||
<Style Selector="Button.CalendarHeader:disabled /template/ ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewWeekDayForegroundDisabled}"/> |
|||
</Style> |
|||
</Border.Styles> |
|||
<!-- 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="HeaderButton" Classes="CalendarHeader" Foreground="{TemplateBinding Foreground}" Padding="12,0,0,0" HorizontalContentAlignment="Left" /> |
|||
<Button Name="PreviousButton" Grid.Column="1" Classes="CalendarHeader CalendarNavigation" Foreground="{TemplateBinding Foreground}" Padding="1" HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path StrokeThickness="1.5" Data="M 0,9 L 9,0 L 18,9" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Button> |
|||
<Button Name="NextButton" Grid.Column="2" Classes="CalendarHeader CalendarNavigation" Foreground="{TemplateBinding Foreground}" Padding="1" HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path StrokeThickness="1.5" Data="M 0,0 L 9,9 L 18,0" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
|||
</Button> |
|||
</Grid> |
|||
<Border Name="BackgroundLayer" Background="{TemplateBinding BorderBrush}" Grid.Row="1" /> |
|||
<Grid Name="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="YearView" 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> |
|||
|
|||
<!-- BackgroundLayer shouldn't show in the week day names row--> |
|||
<Style Selector="Calendar[DisplayMode=Month] CalendarItem /template/ Border#BackgroundLayer"> |
|||
<Setter Property="Margin" Value="0,38,0,0"/> |
|||
</Style> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Calendar /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
</Styles> |
|||
<ControlTheme x:Key="FluentCalendarItemButton" TargetType="Button"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalContentAlignment" Value="Center" /> |
|||
<Setter Property="FontSize" Value="20" /> |
|||
<Setter Property="Background" Value="{DynamicResource CalendarViewNavigationButtonBackground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<!-- HCA was changed here to ensure nav arrows display correctly --> |
|||
<ContentPresenter Name="Text" 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#Text"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CalendarViewNavigationButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource CalendarViewNavigationButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
<Style Selector="^:pressed /template/ ContentPresenter#Text"> |
|||
<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> |
|||
<TextBlock Text="{Binding}" |
|||
HorizontalAlignment="Center" |
|||
VerticalAlignment="Center" |
|||
FontSize="12" /> |
|||
</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="HeaderButton" |
|||
Theme="{StaticResource FluentCalendarItemButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="12,0,0,0" |
|||
HorizontalContentAlignment="Left" /> |
|||
<Button Name="PreviousButton" |
|||
Grid.Column="1" |
|||
Theme="{StaticResource FluentCalendarItemButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="1" |
|||
HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path StrokeThickness="1.5" Data="M 0,9 L 9,0 L 18,9" HorizontalAlignment="Center" VerticalAlignment="Center" /> |
|||
</Button> |
|||
<Button Name="NextButton" |
|||
Grid.Column="2" |
|||
Theme="{StaticResource FluentCalendarItemButton}" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
Padding="1" |
|||
HorizontalContentAlignment="Left"> |
|||
<!--Path mimics Segoe MDL2 Assets font glyph used in WinUI--> |
|||
<Path 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="{ReflectionBinding #MonthView.IsVisible}" Grid.Row="1" /> |
|||
<Grid Name="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="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 > Path"> |
|||
<Setter Property="Stroke" Value="{DynamicResource CalendarViewForeground}" /> |
|||
</Style> |
|||
<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> |
|||
|
|||
@ -1,72 +1,57 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Style Selector="CaptionButtons"> |
|||
<Setter Property="MaxHeight" Value="30" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel Spacing="2" VerticalAlignment="Stretch" TextElement.FontSize="10" Orientation="Horizontal"> |
|||
<StackPanel.Styles> |
|||
<Style Selector="Panel"> |
|||
<Setter Property="Width" Value="45" /> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
<Style Selector="Panel:pointerover"> |
|||
<Setter Property="Background" Value="#7F7f7f7f" /> |
|||
</Style> |
|||
<Style Selector="Panel#PART_CloseButton:pointerover"> |
|||
<Setter Property="Background" Value="#7FFF0000" /> |
|||
</Style> |
|||
<Style Selector="Viewbox"> |
|||
<Setter Property="Width" Value="11" /> |
|||
<Setter Property="Margin" Value="2" /> |
|||
</Style> |
|||
</StackPanel.Styles> |
|||
<Panel x:Name="PART_FullScreenButton"> |
|||
<Viewbox> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
|
|||
<Panel x:Name="PART_MinimiseButton"> |
|||
<Viewbox> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M2048 1229v-205h-2048v205h2048z" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
|
|||
<Panel x:Name="PART_RestoreButton"> |
|||
<Viewbox> |
|||
<Viewbox.RenderTransform> |
|||
<RotateTransform Angle="-90" /> |
|||
</Viewbox.RenderTransform> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}"/> |
|||
</Viewbox> |
|||
</Panel> |
|||
|
|||
<Panel x:Name="PART_CloseButton"> |
|||
<Viewbox> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M1169 1024l879 -879l-145 -145l-879 879l-879 -879l-145 145l879 879l-879 879l145 145l879 -879l879 879l145 -145z" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="CaptionButtons Panel#PART_RestoreButton Path"> |
|||
<Setter Property="Data" Value="M2048 2048v-2048h-2048v2048h2048zM1843 1843h-1638v-1638h1638v1638z" /> |
|||
</Style> |
|||
<Style Selector="CaptionButtons:maximized Panel#PART_RestoreButton Path"> |
|||
<Setter Property="Data" Value="M2048 410h-410v-410h-1638v1638h410v410h1638v-1638zM1434 1434h-1229v-1229h1229v1229zM1843 1843h-1229v-205h1024v-1024h205v1229z" /> |
|||
</Style> |
|||
<Style Selector="CaptionButtons Panel#PART_FullScreenButton"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="CaptionButtons Panel#PART_FullScreenButton Path"> |
|||
<Setter Property="Data" Value="M2048 2048v-819h-205v469l-1493 -1493h469v-205h-819v819h205v-469l1493 1493h-469v205h819z" /> |
|||
</Style> |
|||
<Style Selector="CaptionButtons:fullscreen Panel#PART_FullScreenButton Path"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="Data" Value="M205 1024h819v-819h-205v469l-674 -674l-145 145l674 674h-469v205zM1374 1229h469v-205h-819v819h205v-469l674 674l145 -145z" /> |
|||
</Style> |
|||
<Style Selector="CaptionButtons:fullscreen Panel#PART_RestoreButton, CaptionButtons:fullscreen Panel#PART_MinimiseButton"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type CaptionButtons}" TargetType="CaptionButtons"> |
|||
<Setter Property="MaxHeight" Value="30" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<StackPanel Spacing="2" VerticalAlignment="Stretch" TextElement.FontSize="10" Orientation="Horizontal"> |
|||
<StackPanel.Styles> |
|||
<Style Selector="Panel:pointerover"> |
|||
<Setter Property="Background" Value="#7F7f7f7f" /> |
|||
</Style> |
|||
<Style Selector="Panel#PART_CloseButton:pointerover"> |
|||
<Setter Property="Background" Value="#7FFF0000" /> |
|||
</Style> |
|||
</StackPanel.Styles> |
|||
<Panel x:Name="PART_FullScreenButton" IsVisible="False" Width="45" Background="Transparent"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M2048 2048v-819h-205v469l-1493 -1493h469v-205h-819v819h205v-469l1493 1493h-469v205h819z" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
<Panel x:Name="PART_MinimiseButton" Width="45" Background="Transparent"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M2048 1229v-205h-2048v205h2048z" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
<Panel x:Name="PART_RestoreButton" Width="45" Background="Transparent"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Viewbox.RenderTransform> |
|||
<RotateTransform Angle="-90" /> |
|||
</Viewbox.RenderTransform> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M2048 2048v-2048h-2048v2048h2048zM1843 1843h-1638v-1638h1638v1638z"/> |
|||
</Viewbox> |
|||
</Panel> |
|||
<Panel x:Name="PART_CloseButton" Width="45" Background="Transparent"> |
|||
<Viewbox Width="11" Margin="2"> |
|||
<Path Stretch="UniformToFill" Fill="{TemplateBinding Foreground}" Data="M1169 1024l879 -879l-145 -145l-879 879l-879 -879l-145 145l879 879l-879 879l145 145l879 -879l879 879l145 -145z" /> |
|||
</Viewbox> |
|||
</Panel> |
|||
</StackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^:maximized /template/ Panel#PART_RestoreButton Path"> |
|||
<Setter Property="Data" Value="M2048 410h-410v-410h-1638v1638h410v410h1638v-1638zM1434 1434h-1229v-1229h1229v1229zM1843 1843h-1229v-205h1024v-1024h205v1229z" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_FullScreenButton Path"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="Data" Value="M205 1024h819v-819h-205v469l-674 -674l-145 145l674 674h-469v205zM1374 1229h469v-205h-819v819h205v-469l674 674l145 -145z" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_RestoreButton"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_MinimiseButton"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,17 +1,20 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="Carousel"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<CarouselPresenter IsVirtualized="{TemplateBinding IsVirtualized}" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}" |
|||
SelectedIndex="{TemplateBinding SelectedIndex}" |
|||
PageTransition="{TemplateBinding PageTransition}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type Carousel}" TargetType="Carousel"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Border Background="{TemplateBinding Background}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<CarouselPresenter IsVirtualized="{TemplateBinding IsVirtualized}" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}" |
|||
SelectedIndex="{TemplateBinding SelectedIndex}" |
|||
PageTransition="{TemplateBinding PageTransition}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,297 +1,293 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
Selector="CheckBox"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<CheckBox IsThreeState="True" IsChecked="True" Content="Content" Foreground="Gold" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="32" /> |
|||
<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="32"> |
|||
<Border x:Name="NormalRectangle" |
|||
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" Stretch="Uniform" VerticalAlignment="Center" /> |
|||
</Panel> |
|||
</Viewbox> |
|||
</Grid> |
|||
<ContentPresenter x:Name="ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
RecognizesAccessKey="True" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Grid.Column="1" /> |
|||
<!-- TODO: TextWrapping="Wrap" on contentpresenter --> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Unchecked Normal State --> |
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUnchecked}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUnchecked}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUnchecked}" /> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
|
|||
<!-- Unchecked PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ ContentPresenter#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#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#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="M1507 31L438 1101L-119 543L-29 453L438 919L1417 -59L1507 31Z" /> |
|||
<Setter Property="Width" Value="9" /> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
<Setter Property="FlowDirection" Value="LeftToRight" /> |
|||
</Style> |
|||
|
|||
<!-- Checked PointerOver State --> |
|||
<Style Selector="^:pointerover"> |
|||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPointerOver}" /> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<CheckBox IsThreeState="True" IsChecked="True" Content="Content" Foreground="Gold" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="MinHeight" Value="32" /> |
|||
<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="32"> |
|||
<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" /> |
|||
</Panel> |
|||
</Viewbox> |
|||
</Grid> |
|||
<ContentPresenter x:Name="ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
RecognizesAccessKey="True" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Grid.Column="1" /> |
|||
<!-- TODO: TextWrapping="Wrap" on contentpresenter --> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Unchecked PointerOver State --> |
|||
<Style Selector="^:pointerover /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPointerOver}" /> |
|||
<!-- Unchecked Pressed State --> |
|||
<Style Selector="^:pressed /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedPressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPointerOver}" /> |
|||
<!-- Unchecked Disabled state --> |
|||
<Style Selector="^:disabled /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundUncheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeUncheckedDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillUncheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundUncheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedPointerOver}" /> |
|||
<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="M1507 31L438 1101L-119 543L-29 453L438 919L1417 -59L1507 31Z" /> |
|||
<Setter Property="Width" Value="9" /> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
<Setter Property="FlowDirection" Value="LeftToRight" /> |
|||
</Style> |
|||
|
|||
<!-- Checked PointerOver State --> |
|||
<Style Selector="^:pointerover /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedPointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Checked Pressed State --> |
|||
<Style Selector="^:pressed /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedPressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Checked Disabled State --> |
|||
<Style Selector="^:disabled /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundCheckedDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeCheckedDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillCheckedDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundCheckedDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Checked Pressed State --> |
|||
<Style Selector="^:pressed"> |
|||
<Style Selector="^ /template/ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundCheckedPressed}" /> |
|||
<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 /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminatePointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminatePointerOver}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminatePointerOver}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminatePointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Indeterminate Pressed State --> |
|||
<Style Selector="^:pressed /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminatePressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminatePressed}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminatePressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminatePressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Indeterminate Disabled State --> |
|||
<Style Selector="^:disabled /template/"> |
|||
<Style Selector="^ ContentPresenter#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource CheckBoxForegroundIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#PART_Border"> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxBackgroundIndeterminateDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxBorderBrushIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Border#NormalRectangle"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource CheckBoxCheckBackgroundStrokeIndeterminateDisabled}" /> |
|||
<Setter Property="Background" Value="{DynamicResource CheckBoxCheckBackgroundFillIndeterminateDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ Path#CheckGlyph"> |
|||
<Setter Property="Fill" Value="{DynamicResource CheckBoxCheckGlyphForegroundIndeterminateDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</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="^ /template/ ContentPresenter#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#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#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#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> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,232 +1,228 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Styles.Resources> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
</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> |
|||
</Styles.Resources> |
|||
<Style Selector="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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Grid RowDefinitions="Auto, *, Auto" |
|||
ColumnDefinitions="*,32"> |
|||
<ContentPresenter x:Name="HeaderContentPresenter" |
|||
Grid.Row="0" |
|||
|
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="PlaceholderForeground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DataValidationErrors> |
|||
<Grid RowDefinitions="Auto, *, Auto" ColumnDefinitions="*,32"> |
|||
<ContentPresenter x:Name="HeaderContentPresenter" |
|||
Grid.Row="0" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
IsVisible="False" |
|||
FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}" |
|||
Margin="{DynamicResource ComboBoxTopHeaderMargin}" |
|||
VerticalAlignment="Top" /> |
|||
<Border x:Name="Background" |
|||
Grid.Row="1" |
|||
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.Row="1" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
Background="{DynamicResource ComboBoxBackgroundUnfocused}" |
|||
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
<TextBlock x:Name="PlaceholderTextBlock" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Margin="{TemplateBinding Padding}" |
|||
Text="{TemplateBinding PlaceholderText}" |
|||
Foreground="{TemplateBinding PlaceholderForeground}" |
|||
IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}" /> |
|||
<ContentControl x:Name="ContentPresenter" |
|||
Content="{TemplateBinding SelectionBoxItem}" |
|||
ContentTemplate="{TemplateBinding ItemTemplate}" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
IsVisible="False" |
|||
FontWeight="{DynamicResource ComboBoxHeaderThemeFontWeight}" |
|||
Margin="{DynamicResource ComboBoxTopHeaderMargin}" |
|||
VerticalAlignment="Top" /> |
|||
<Border x:Name="Background" |
|||
Grid.Row="1" |
|||
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.Row="1" |
|||
Grid.Column="0" |
|||
Grid.ColumnSpan="2" |
|||
Background="{DynamicResource ComboBoxBackgroundUnfocused}" |
|||
BorderBrush="{DynamicResource ComboBoxBackgroundBorderBrushUnfocused}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" /> |
|||
<TextBlock x:Name="PlaceholderTextBlock" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Margin="{TemplateBinding Padding}" |
|||
Text="{TemplateBinding PlaceholderText}" |
|||
Foreground="{TemplateBinding PlaceholderForeground}" |
|||
IsVisible="{TemplateBinding SelectionBoxItem, Converter={x:Static ObjectConverters.IsNull}}" /> |
|||
<ContentControl x:Name="ContentPresenter" |
|||
Content="{TemplateBinding SelectionBoxItem}" |
|||
ContentTemplate="{TemplateBinding ItemTemplate}" |
|||
Grid.Row="1" |
|||
Grid.Column="0" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
|
|||
<Border x:Name="DropDownOverlay" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
Background="Transparent" |
|||
Margin="0,1,1,1" |
|||
Width="30" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Right" /> |
|||
|
|||
<PathIcon x:Name="DropDownGlyph" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" /> |
|||
|
|||
<Border x:Name="DropDownOverlay" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
UseLayoutRounding="False" |
|||
IsHitTestVisible="False" |
|||
Height="12" |
|||
Width="12" |
|||
Margin="0,0,10,0" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" /> |
|||
|
|||
<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}" |
|||
Margin="0,-1,0,-1" |
|||
Padding="{DynamicResource ComboBoxDropdownBorderPadding}" |
|||
HorizontalAlignment="Stretch" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
Margin="{DynamicResource ComboBoxDropdownContentMargin}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- Normal State --> |
|||
<Style Selector="ComboBox /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox /template/ Border#HighlightBackground"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" /> |
|||
<Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="ComboBox:pointerover /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="ComboBox:pressed /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushPressed}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="ComboBox:disabled /template/ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:disabled /template/ ContentPresenter#HeaderContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:disabled /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:disabled /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:disabled /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="ComboBox:focus-visible /template/ Border#HighlightBackground"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBackgroundBorderBrushFocused}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:focus-visible /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:focus-visible /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:focus-visible /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" /> |
|||
</Style> |
|||
|
|||
<!-- Focus Pressed State --> |
|||
<Style Selector="ComboBox:focused:pressed /template/ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocusedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:focused:pressed /template/ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ComboBox:focused:pressed /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" /> |
|||
</Style> |
|||
Background="Transparent" |
|||
Margin="0,1,1,1" |
|||
Width="30" |
|||
IsVisible="False" |
|||
HorizontalAlignment="Right" /> |
|||
|
|||
<PathIcon x:Name="DropDownGlyph" |
|||
Grid.Row="1" |
|||
Grid.Column="1" |
|||
UseLayoutRounding="False" |
|||
IsHitTestVisible="False" |
|||
Height="12" |
|||
Width="12" |
|||
Margin="0,0,10,0" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" /> |
|||
|
|||
<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}" |
|||
Margin="0,-1,0,-1" |
|||
Padding="{DynamicResource ComboBoxDropdownBorderPadding}" |
|||
HorizontalAlignment="Stretch" |
|||
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|||
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
Margin="{DynamicResource ComboBoxDropdownContentMargin}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</Popup> |
|||
</Grid> |
|||
</DataValidationErrors> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Normal State --> |
|||
<Style Selector="^ /template/"> |
|||
<Style Selector="^ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForeground}" /> |
|||
</Style> |
|||
<Style Selector="^ Border#HighlightBackground"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" /> |
|||
<Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- 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="^:focused:pressed /template/"> |
|||
<Style Selector="^ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocusedPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxPlaceHolderForegroundFocusedPressed}" /> |
|||
</Style> |
|||
<Style Selector="^ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocusedPressed}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Focused State --> |
|||
<Style Selector="^:focus-visible /template/"> |
|||
<Style Selector="^ Border#HighlightBackground"> |
|||
<Setter Property="IsVisible" Value="True" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBackgroundBorderBrushFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundFocused}" /> |
|||
</Style> |
|||
<Style Selector="^ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundFocused}" /> |
|||
</Style> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="^:disabled /template/"> |
|||
<Style Selector="^ Border#Background"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxBorderBrushDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ ContentPresenter#HeaderContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ ContentControl#ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ TextBlock#PlaceholderTextBlock"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxForegroundDisabled}" /> |
|||
</Style> |
|||
<Style Selector="^ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForegroundDisabled}" /> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
<!-- Error State --> |
|||
<Style Selector="ComboBox:error /template/ Border#Background"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}"/> |
|||
</Style> |
|||
</Styles> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,90 +1,85 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<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> |
|||
</StackPanel> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
</StackPanel> |
|||
</Border> |
|||
</Border> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
</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> |
|||
|
|||
<Style Selector="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> |
|||
</Style> |
|||
|
|||
<!-- PointerOver state --> |
|||
<Style Selector="ComboBoxItem: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="ComboBoxItem: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="ComboBoxItem: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="ComboBoxItem:selected /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="ComboBoxItem:selected: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="ComboBoxItem:selected: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="ComboBoxItem:selected:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource ComboBoxItemBackgroundSelectedPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxItemBorderBrushSelectedPressed}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxItemForegroundSelectedPressed}" /> |
|||
</Style> |
|||
</Styles> |
|||
<!-- 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> |
|||
|
|||
@ -1,6 +0,0 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Style Selector="TextBlock.CaptionTextBlockStyle"> |
|||
<Setter Property="FontSize" Value="12" /> |
|||
<Setter Property="FontWeight" Value="Normal" /> |
|||
</Style> |
|||
</Styles> |
|||
@ -1,16 +1,19 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="ContentControl"> |
|||
<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> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type ContentControl}" TargetType="ContentControl"> |
|||
<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> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,72 +1,72 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
Selector="ContextMenu"> |
|||
<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> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
|
|||
<Style.Resources> |
|||
<!-- Added missing resource --> |
|||
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness> |
|||
</Style.Resources> |
|||
|
|||
<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="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="TextBlock.FontWeight" Value="Normal" /> |
|||
<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 Classes="menuscroller"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<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="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="TextBlock.FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="TextBlock.FontWeight" Value="Normal" /> |
|||
<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 Classes="menuscroller"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
|
|||
@ -1,104 +1,103 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:CompileBindings="True" |
|||
x:DataType="DataValidationErrors"> |
|||
<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="Template" Value="{DynamicResource TooltipDataValidationContentTemplate}" /> |
|||
<Setter Property="ErrorTemplate" Value="{DynamicResource TooltipDataValidationErrorTemplate}" /> |
|||
</Style> |
|||
</TextBox.Styles> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception /> |
|||
</DataValidationErrors.Error> |
|||
</TextBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style Selector="DataValidationErrors"> |
|||
<Style.Resources> |
|||
<DataTemplate x:Key="InlineDataValidationErrorTemplate"> |
|||
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
|||
<ItemsControl.Styles> |
|||
<Style Selector="TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style> |
|||
</ItemsControl.Styles> |
|||
</ItemsControl> |
|||
</DataTemplate> |
|||
<ControlTemplate x:Key="InlineDataValidationContentTemplate" 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}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
|
|||
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate"> |
|||
<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 Items="{Binding}" /> |
|||
</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> |
|||
<ControlTemplate x:Key="TooltipDataValidationContentTemplate" 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}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Style.Resources> |
|||
|
|||
<Setter Property="Template" Value="{StaticResource InlineDataValidationContentTemplate}" /> |
|||
<Setter Property="ErrorTemplate" Value="{StaticResource InlineDataValidationErrorTemplate}" /> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="using:System" |
|||
x:CompileBindings="True" |
|||
x:DataType="DataValidationErrors"> |
|||
<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="Template" Value="{DynamicResource TooltipDataValidationContentTemplate}" /> |
|||
<Setter Property="ErrorTemplate" Value="{DynamicResource TooltipDataValidationErrorTemplate}" /> |
|||
</Style> |
|||
</TextBox.Styles> |
|||
<DataValidationErrors.Error> |
|||
<sys:Exception /> |
|||
</DataValidationErrors.Error> |
|||
</TextBox> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type DataValidationErrors}" TargetType="DataValidationErrors"> |
|||
<ControlTheme.Resources> |
|||
<DataTemplate x:Key="InlineDataValidationErrorTemplate"> |
|||
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
|||
<ItemsControl.Styles> |
|||
<Style Selector="TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style> |
|||
</ItemsControl.Styles> |
|||
</ItemsControl> |
|||
</DataTemplate> |
|||
<ControlTemplate x:Key="InlineDataValidationContentTemplate" 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}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
|
|||
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate"> |
|||
<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 Items="{Binding}" /> |
|||
</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> |
|||
<ControlTemplate x:Key="TooltipDataValidationContentTemplate" 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}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</ControlTheme.Resources> |
|||
<Setter Property="Template" Value="{StaticResource InlineDataValidationContentTemplate}" /> |
|||
<Setter Property="ErrorTemplate" Value="{StaticResource InlineDataValidationErrorTemplate}" /> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,103 +1,101 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<DropDownButton Content="Click Me!" /> |
|||
<DropDownButton Content="Disabled" IsEnabled="False" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Styles.Resources> |
|||
<x:Double x:Key="DropDownButtonMinHeight">32</x:Double> |
|||
</Styles.Resources> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<DropDownButton Content="Click Me!" /> |
|||
<DropDownButton Content="Disabled" IsEnabled="False" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style Selector="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="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> |
|||
<Setter Property="FocusVisualMargin" Value="-3" />--> |
|||
<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}" |
|||
RecognizesAccessKey="True" |
|||
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" |
|||
HorizontalAlignment="Right" |
|||
VerticalAlignment="Center" /> |
|||
|
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- Normal State --> |
|||
<Style Selector="DropDownButton /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" /> |
|||
<Setter Property="Data" Value="M1939 486L2029 576L1024 1581L19 576L109 486L1024 1401L1939 486Z" /> |
|||
</Style> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="DropDownButton:pointerover /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPointerOver}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="DropDownButton:pressed /template/ Border#RootBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ButtonBackgroundPressed}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonBorderBrushPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource ButtonForegroundPressed}" /> |
|||
</Style> |
|||
<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}" |
|||
RecognizesAccessKey="True" |
|||
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" /> |
|||
</Grid> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter.Value> |
|||
</Setter> |
|||
|
|||
<!-- Normal State --> |
|||
<Style Selector="^ /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ComboBoxDropDownGlyphForeground}" /> |
|||
</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> |
|||
|
|||
<!-- Pressed State --> |
|||
<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> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="DropDownButton: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="DropDownButton:disabled /template/ PathIcon#DropDownGlyph"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ButtonForegroundDisabled}" /> |
|||
</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> |
|||
|
|||
</Styles> |
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
|
|||
@ -1,19 +1,23 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="EmbeddableControlRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<Border Background="{TemplateBinding Background}"> |
|||
<VisualLayerManager> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</Border> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type EmbeddableControlRoot}" TargetType="EmbeddableControlRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<Border Background="{TemplateBinding Background}"> |
|||
<VisualLayerManager> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</Border> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
|
|||
</ResourceDictionary> |
|||
|
|||
@ -1,70 +1,78 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:Class="Avalonia.Themes.Fluent.Controls.FluentControls"> |
|||
<!-- Define ToolTip first so its styles can be overriden by other controls (e.g. TextBox) --> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToolTip.xaml"/> |
|||
<!-- PathIcon also needs to be defined early so it can be overriden by other styles (e.g. ComboBox) --> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/PathIcon.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Button.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CaptionButtons.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Carousel.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CheckBox.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBox.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContentControl.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/DropDownButton.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Label.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/GridSplitter.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ItemsControl.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBox.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Menu.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContextMenu.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/MenuItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/PopupRoot.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ProgressBar.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/RadioButton.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/RepeatButton.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Separator.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Slider.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollBar.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStrip.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStripItem.xaml"/> |
|||
<!-- TabControl needs to come after TabStrip as it redefines the inner TabStrip.ItemsPanel--> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabControl.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TextBox.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleButton.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Expander.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TitleBar.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeView.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/UserControl.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Window.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarButton.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarItem.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/Calendar.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NotificationCard.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/SplitButton.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/SplitView.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/DatePicker.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TimePicker.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml"/> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml"/> |
|||
<!-- ManagedFileChooser comes last because it uses (and overrides) styles for a multitude of other controls...the dialogs were originally UserControls, after all--> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml"/> |
|||
<Styles |
|||
x:Class="Avalonia.Themes.Fluent.Controls.FluentControls" |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Styles.Resources> |
|||
<ResourceDictionary> |
|||
<ResourceDictionary.MergedDictionaries> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Button.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/RadioButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Expander.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ProgressBar.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Calendar.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarDayButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CalendarItem.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CaptionButtons.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Carousel.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/CheckBox.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/FlyoutPresenter.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/GridSplitter.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ItemsControl.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Label.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBox.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ListBoxItem.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Menu.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/MenuFlyoutPresenter.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/NotificationCard.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/NumericUpDown.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/OverlayPopupHost.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/PopupRoot.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/PathIcon.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/RepeatButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Separator.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabControl.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabItem.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStrip.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TabStripItem.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToggleSwitch.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ToolTip.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TitleBar.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TransitioningContentControl.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeView.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Window.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBox.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ComboBoxItem.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContentControl.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/ContextMenu.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/DatePicker.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/DropDownButton.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/EmbeddableControlRoot.xaml" /> |
|||
<ResourceInclude Source="avares://Avalonia.Themes.Fluent/Controls/Slider.xaml" /> |
|||
</ResourceDictionary.MergedDictionaries> |
|||
</ResourceDictionary> |
|||
</Styles.Resources> |
|||
|
|||
<!-- Define ToolTip first so its styles can be overriden by other controls (e.g. TextBox) --> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/FocusAdorner.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/MenuItem.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ScrollBar.xaml" /> |
|||
<!-- TabControl needs to come after TabStrip as it redefines the inner TabStrip.ItemsPanel --> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TextBox.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TreeViewItem.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/SplitButton.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/SplitView.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/UserControl.xaml" /> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/TimePicker.xaml" /> |
|||
<!-- ManagedFileChooser comes last because it uses (and overrides) styles for a multitude of other controls...the dialogs were originally UserControls, after all --> |
|||
<StyleInclude Source="avares://Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml" /> |
|||
<Styles.Resources /> |
|||
</Styles> |
|||
|
|||
@ -1,24 +1,22 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
|
|||
<Style Selector="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> |
|||
</Style> |
|||
|
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
|
|||
@ -1,16 +1,19 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}"/> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,18 +1,22 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="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}" |
|||
RecognizesAccessKey="True" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
|
|||
<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}" |
|||
RecognizesAccessKey="True" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,45 +1,47 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<ListBox> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
<ListBoxItem>Test</ListBoxItem> |
|||
</ListBox> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<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" |
|||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{TemplateBinding Padding}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}"/> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<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" |
|||
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}" |
|||
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}" |
|||
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{TemplateBinding Padding}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,94 +1,79 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
<Styles.Resources> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
</Styles.Resources> |
|||
<Style Selector="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> |
|||
<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}" |
|||
FontWeight="Normal" |
|||
FontSize="{DynamicResource ControlContentThemeFontSize}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="ListBoxItem /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="FontWeight" Value="Normal" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
</Style> |
|||
<Style Selector="^:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlDisabledBaseMediumLowBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Disabled State --> |
|||
<Style Selector="ListBoxItem: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> |
|||
|
|||
<!-- PointerOver State --> |
|||
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListLowBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<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> |
|||
|
|||
<!-- Pressed State --> |
|||
<Style Selector="ListBoxItem:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListMediumBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:pressed /template/ ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
<!-- Selected State --> |
|||
<Style Selector="^:selected"> |
|||
|
|||
<!-- Selected State --> |
|||
<Style Selector="ListBoxItem:selected /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:selected /template/ ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected Unfocused State --> |
|||
<Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentLowBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:selected:not(:focus) /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<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="ListBoxItem:selected:pointerover /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentMediumBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:selected:pointerover /template/ ContentPresenter"> |
|||
<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="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlHighlightListAccentHighBrush}" /> |
|||
</Style> |
|||
<Style Selector="ListBoxItem:selected:pressed /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlHighlightAltBaseHighBrush}" /> |
|||
</Style> |
|||
</Styles> |
|||
<!-- 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> |
|||
|
|||
@ -1,324 +1,324 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:dialogs="clr-namespace:Avalonia.Dialogs;assembly=Avalonia.Dialogs"> |
|||
<Style Selector="dialogs|ManagedFileChooser"> |
|||
<Style.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> |
|||
<dialogs: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 |
|||
<Style Selector="dialogs|ManagedFileChooser"> |
|||
<Style.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> |
|||
<dialogs: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 |
|||
<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 |
|||
<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 |
|||
</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 |
|||
<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> |
|||
</dialogs:ResourceSelectorConverter> |
|||
</ResourceDictionary> |
|||
</Style.Resources> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel> |
|||
<ListBox x:Name="QuickLinks" DockPanel.Dock="Left" Items="{Binding QuickLinks}" SelectedIndex="{Binding QuickLinksSelectedIndex}" Focusable="False"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent"> |
|||
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
<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"> |
|||
<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> |
|||
<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}" |
|||
Items="{Binding Filters}" |
|||
SelectedItem="{Binding SelectedFilter}" /> |
|||
<TextBox Text="{Binding FileName}" Watermark="File name" IsVisible="{Binding !SelectingFolder}" /> |
|||
</DockPanel> |
|||
<CheckBox IsChecked="{Binding ShowHiddenFiles}" Content="Show hidden files" DockPanel.Dock="Left"/> |
|||
<UniformGrid x:Name="Finalize" HorizontalAlignment="Right" Rows="1"> |
|||
<Button Command="{Binding Ok}">OK</Button> |
|||
<Button Command="{Binding Cancel}">Cancel</Button> |
|||
</UniformGrid> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
<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> |
|||
</dialogs:ResourceSelectorConverter> |
|||
</ResourceDictionary> |
|||
</Style.Resources> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<DockPanel> |
|||
<ListBox x:Name="QuickLinks" DockPanel.Dock="Left" Items="{Binding QuickLinks}" SelectedIndex="{Binding QuickLinksSelectedIndex}" Focusable="False"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<StackPanel Spacing="4" Orientation="Horizontal" Background="Transparent"> |
|||
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
<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"> |
|||
<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> |
|||
<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}" |
|||
Items="{Binding Filters}" |
|||
SelectedItem="{Binding SelectedFilter}" /> |
|||
<TextBox Text="{Binding FileName}" Watermark="File name" IsVisible="{Binding !SelectingFolder}" /> |
|||
</DockPanel> |
|||
<CheckBox IsChecked="{Binding ShowHiddenFiles}" Content="Show hidden files" DockPanel.Dock="Left"/> |
|||
<UniformGrid x:Name="Finalize" HorizontalAlignment="Right" Rows="1"> |
|||
<Button Command="{Binding Ok}">OK</Button> |
|||
<Button Command="{Binding Cancel}">Cancel</Button> |
|||
</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="16" SharedSizeGroup="Splitter" /> |
|||
<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" /> |
|||
</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> |
|||
<GridSplitter Grid.Column="1" /> |
|||
<TextBlock Grid.Column="2" Text="Name" /> |
|||
<GridSplitter Grid.Column="3" /> |
|||
<TextBlock Grid.Column="4" Text="Date Modified" /> |
|||
<GridSplitter Grid.Column="5" /> |
|||
<TextBlock Grid.Column="6" Text="Type" /> |
|||
<GridSplitter Grid.Column="7" /> |
|||
<TextBlock Grid.Column="8" Text="Size" /> |
|||
</Grid> |
|||
<ListBox x:Name="Files" |
|||
VirtualizationMode="Simple" |
|||
Items="{Binding Items}" |
|||
Margin="0 5" |
|||
SelectionMode="{Binding SelectionMode}" |
|||
SelectedItems="{Binding SelectedItems}" |
|||
Background="Transparent" |
|||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Background="Transparent"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition SharedSizeGroup="Icon" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Name" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Modified" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Type" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Size" /> |
|||
</Grid.ColumnDefinitions> |
|||
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
<TextBlock Grid.Column="2" Text="{Binding DisplayName}"/> |
|||
<TextBlock Grid.Column="4" Text="{Binding Modified}" /> |
|||
<TextBlock Grid.Column="6" Text="{Binding Type}" /> |
|||
<TextBlock Grid.Column="8"> |
|||
<TextBlock.Text> |
|||
<Binding Path="Size"> |
|||
<Binding.Converter> |
|||
<dialogs:FileSizeStringConverter/> |
|||
</Binding.Converter> |
|||
</Binding> |
|||
</TextBlock.Text> |
|||
</TextBlock> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<DockPanel Grid.IsSharedSizeScope="True"> |
|||
<Grid DockPanel.Dock="Top" Margin="15 5 0 0" HorizontalAlignment="Stretch"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition Width="20" SharedSizeGroup="Icon" /> |
|||
<ColumnDefinition Width="16" SharedSizeGroup="Splitter" /> |
|||
<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" /> |
|||
</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> |
|||
<GridSplitter Grid.Column="1" /> |
|||
<TextBlock Grid.Column="2" Text="Name" /> |
|||
<GridSplitter Grid.Column="3" /> |
|||
<TextBlock Grid.Column="4" Text="Date Modified" /> |
|||
<GridSplitter Grid.Column="5" /> |
|||
<TextBlock Grid.Column="6" Text="Type" /> |
|||
<GridSplitter Grid.Column="7" /> |
|||
<TextBlock Grid.Column="8" Text="Size" /> |
|||
</Grid> |
|||
<ListBox x:Name="Files" |
|||
VirtualizationMode="Simple" |
|||
Items="{Binding Items}" |
|||
Margin="0 5" |
|||
SelectionMode="{Binding SelectionMode}" |
|||
SelectedItems="{Binding SelectedItems}" |
|||
Background="Transparent" |
|||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"> |
|||
<ListBox.ItemTemplate> |
|||
<DataTemplate> |
|||
<Grid Background="Transparent"> |
|||
<Grid.ColumnDefinitions> |
|||
<ColumnDefinition SharedSizeGroup="Icon" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Name" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Modified" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Type" /> |
|||
<ColumnDefinition SharedSizeGroup="Splitter" /> |
|||
<ColumnDefinition SharedSizeGroup="Size" /> |
|||
</Grid.ColumnDefinitions> |
|||
<DrawingPresenter Width="16" Height="16" Drawing="{Binding IconKey, Converter={StaticResource Icons}}"/> |
|||
<TextBlock Grid.Column="2" Text="{Binding DisplayName}"/> |
|||
<TextBlock Grid.Column="4" Text="{Binding Modified}" /> |
|||
<TextBlock Grid.Column="6" Text="{Binding Type}" /> |
|||
<TextBlock Grid.Column="8"> |
|||
<TextBlock.Text> |
|||
<Binding Path="Size"> |
|||
<Binding.Converter> |
|||
<dialogs:FileSizeStringConverter/> |
|||
</Binding.Converter> |
|||
</Binding> |
|||
</TextBlock.Text> |
|||
</TextBlock> |
|||
</Grid> |
|||
</DataTemplate> |
|||
</ListBox.ItemTemplate> |
|||
</ListBox> |
|||
</DockPanel> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
|
|||
<Style Selector="dialogs|ManagedFileChooser /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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{TemplateBinding Padding}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}"/> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks 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}"/> |
|||
<Style Selector="dialogs|ManagedFileChooser /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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{TemplateBinding Padding}" |
|||
VirtualizationMode="{TemplateBinding VirtualizationMode}"/> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks 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> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks ListBoxItem:pointerover /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumBrush}"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks ListBoxItem:selected /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumHighBrush}"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button, |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks ListBoxItem:pointerover /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumBrush}"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ ListBox#QuickLinks ListBoxItem:selected /template/ Border#LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltMediumHighBrush}"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button, |
|||
dialogs|ManagedFileChooser /template/ DockPanel#NavBar TextBox"> |
|||
<Setter Property="Height" Value="30"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button"> |
|||
<Setter Property="VerticalAlignment" Value="Stretch"/> |
|||
<Setter Property="Width" Value="40"/> |
|||
<Setter Property="Margin" Value="0,0,8,0"/> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button:not(:pointerover):not(:pressed)"> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
</Style> |
|||
<Setter Property="Height" Value="30"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button"> |
|||
<Setter Property="VerticalAlignment" Value="Stretch"/> |
|||
<Setter Property="Width" Value="40"/> |
|||
<Setter Property="Margin" Value="0,0,8,0"/> |
|||
<Setter Property="BorderThickness" Value="0"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ DockPanel#NavBar Button:not(:pointerover):not(:pressed)"> |
|||
<Setter Property="Background" Value="Transparent"/> |
|||
</Style> |
|||
|
|||
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center"/> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
<Setter Property="Margin" Value="4,0,0,0"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Center"/> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
<Setter Property="Margin" Value="4,0,0,0"/> |
|||
</Style> |
|||
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|||
</Style> |
|||
</Styles> |
|||
|
|||
@ -1,36 +1,35 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
Selector="Menu"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Menu> |
|||
<MenuItem Header="New" /> |
|||
<MenuItem Header="Open" /> |
|||
</Menu> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<Menu> |
|||
<MenuItem Header="New" /> |
|||
<MenuItem Header="Open" /> |
|||
</Menu> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style.Resources> |
|||
<x:Double x:Key="MenuBarHeight">32</x:Double> |
|||
</Style.Resources> |
|||
|
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Height" Value="{DynamicResource MenuBarHeight}" /> |
|||
<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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
VerticalAlignment="Stretch" |
|||
KeyboardNavigation.TabNavigation="Continue" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ControlTheme x:Key="{x:Type Menu}" TargetType="Menu"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Height" Value="{DynamicResource MenuBarHeight}" /> |
|||
<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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
VerticalAlignment="Stretch" |
|||
KeyboardNavigation.TabNavigation="Continue" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,35 +1,34 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
|
|||
<Style Selector="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}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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}" |
|||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|||
KeyboardNavigation.TabNavigation="Continue" |
|||
Grid.IsSharedSizeScope="True" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,30 +1,29 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Avalonia.Themes.Fluent" |
|||
x:CompileBindings="True" |
|||
Selector="NativeMenuBar"> |
|||
<Style.Resources> |
|||
<local:InverseBooleanValueConverter x:Key="AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter" Default="True"/> |
|||
<local:IBitmapToImageConverter x:Key="AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter"/> |
|||
</Style.Resources> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Menu |
|||
IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter}}" |
|||
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}"> |
|||
<Menu.Styles> |
|||
<Style x:CompileBindings="False" Selector="MenuItem"> |
|||
<Setter Property="Header" Value="{Binding Header}"/> |
|||
<Setter Property="InputGesture" Value="{Binding Gesture}"/> |
|||
<Setter Property="Items" Value="{Binding Menu.Items}"/> |
|||
<Setter Property="Command" Value="{Binding Command}"/> |
|||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}"/> |
|||
<Setter Property="(NativeMenuBar.EnableMenuItemClickForwarding)" Value="True"/> |
|||
<!--NativeMenuItem is IBitmap and MenuItem is Image--> |
|||
<Setter Property="Icon" Value="{Binding Icon , Converter={StaticResource AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter}}"/> |
|||
</Style> |
|||
</Menu.Styles> |
|||
</Menu> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:local="clr-namespace:Avalonia.Themes.Fluent" |
|||
x:CompileBindings="True"> |
|||
<local:InverseBooleanValueConverter x:Key="AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter" Default="True"/> |
|||
<local:IBitmapToImageConverter x:Key="AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter"/> |
|||
<ControlTheme x:Key="{x:Type NativeMenuBar}" TargetType="NativeMenuBar"> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Menu |
|||
IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesFluentNativeMenuBarInverseBooleanValueConverter}}" |
|||
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}"> |
|||
<Menu.Styles> |
|||
<Style x:CompileBindings="False" Selector="MenuItem"> |
|||
<Setter Property="Header" Value="{Binding Header}"/> |
|||
<Setter Property="InputGesture" Value="{Binding Gesture}"/> |
|||
<Setter Property="Items" Value="{Binding Menu.Items}"/> |
|||
<Setter Property="Command" Value="{Binding Command}"/> |
|||
<Setter Property="CommandParameter" Value="{Binding CommandParameter}"/> |
|||
<Setter Property="(NativeMenuBar.EnableMenuItemClickForwarding)" Value="True"/> |
|||
<!--NativeMenuItem is IBitmap and MenuItem is Image--> |
|||
<Setter Property="Icon" Value="{Binding Icon , Converter={StaticResource AvaloniaThemesFluentNativeMenuBarIBitmapToImageConverter}}"/> |
|||
</Style> |
|||
</Menu.Styles> |
|||
</Menu> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,68 +1,67 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
Width="150" |
|||
Watermark="Enter text" /> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
Width="150" |
|||
VerticalContentAlignment="Center" |
|||
HorizontalContentAlignment="Center" |
|||
ButtonSpinnerLocation="Left" |
|||
Watermark="Enter text" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style Selector="NumericUpDown"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" /> |
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ButtonSpinner Name="PART_Spinner" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="0" |
|||
MinWidth="0" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
AllowSpin="{TemplateBinding AllowSpin}" |
|||
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" |
|||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
|||
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> |
|||
<TextBox Name="PART_TextBox" |
|||
Background="Transparent" |
|||
BorderBrush="Transparent" |
|||
Margin="-1" |
|||
Padding="{TemplateBinding Padding}" |
|||
MinWidth="0" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
Watermark="{TemplateBinding Watermark}" |
|||
IsReadOnly="{TemplateBinding IsReadOnly}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Text="{TemplateBinding Text}" |
|||
AcceptsReturn="False" |
|||
TextWrapping="NoWrap" /> |
|||
</ButtonSpinner> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
Width="150" |
|||
Watermark="Enter text" /> |
|||
<NumericUpDown Minimum="0" |
|||
Maximum="10" |
|||
Increment="0.5" |
|||
Width="150" |
|||
VerticalContentAlignment="Center" |
|||
HorizontalContentAlignment="Center" |
|||
ButtonSpinnerLocation="Left" |
|||
Watermark="Enter text" /> |
|||
</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="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" /> |
|||
<Setter Property="MinHeight" Value="{DynamicResource TextControlThemeMinHeight}" /> |
|||
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ButtonSpinner Name="PART_Spinner" |
|||
Background="{TemplateBinding Background}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="0" |
|||
MinWidth="0" |
|||
HorizontalContentAlignment="Stretch" |
|||
VerticalContentAlignment="Stretch" |
|||
AllowSpin="{TemplateBinding AllowSpin}" |
|||
ShowButtonSpinner="{TemplateBinding ShowButtonSpinner}" |
|||
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" |
|||
ButtonSpinnerLocation="{TemplateBinding ButtonSpinnerLocation}"> |
|||
<TextBox Name="PART_TextBox" |
|||
Background="Transparent" |
|||
BorderBrush="Transparent" |
|||
Margin="-1" |
|||
Padding="{TemplateBinding Padding}" |
|||
MinWidth="0" |
|||
Foreground="{TemplateBinding Foreground}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
Watermark="{TemplateBinding Watermark}" |
|||
IsReadOnly="{TemplateBinding IsReadOnly}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
Text="{TemplateBinding Text}" |
|||
AcceptsReturn="False" |
|||
TextWrapping="NoWrap" /> |
|||
</ButtonSpinner> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,20 +1,23 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="OverlayPopupHost"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}"/> |
|||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" /> |
|||
<Setter Property="FontWeight" Value="400" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<VisualLayerManager IsPopup="True"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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="400" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<VisualLayerManager IsPopup="True"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,29 +1,26 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
<Style Selector="PathIcon"> |
|||
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<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> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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="Foreground" Value="{DynamicResource TextControlForeground}" /> |
|||
<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> |
|||
|
|||
@ -1,28 +1,28 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Style Selector="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="400" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<VisualLayerManager IsPopup="True"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}"/> |
|||
</VisualLayerManager> |
|||
</Panel> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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="400" /> |
|||
<Setter Property="FontStyle" Value="Normal" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<LayoutTransformControl LayoutTransform="{TemplateBinding Transform}"> |
|||
<Panel> |
|||
<Border Name="PART_TransparencyFallback" IsHitTestVisible="False" /> |
|||
<VisualLayerManager IsPopup="True"> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
Background="{TemplateBinding Background}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Padding="{TemplateBinding Padding}" /> |
|||
</VisualLayerManager> |
|||
</Panel> |
|||
</LayoutTransformControl> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,164 +1,179 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="10"> |
|||
<ProgressBar VerticalAlignment="Center" IsIndeterminate="True" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="5" Maximum="10" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="50" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="50" Minimum="25" Maximum="75" /> |
|||
<ProgressBar HorizontalAlignment="Left" IsIndeterminate="True" Orientation="Vertical" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="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> |
|||
<Border x:Name="ProgressBarRoot" ClipToBounds="True" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Panel> |
|||
<Panel x:Name="DeterminateRoot"> |
|||
<Border CornerRadius="{TemplateBinding CornerRadius}" x:Name="PART_Indicator" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> |
|||
</Panel> |
|||
<Panel x:Name="IndeterminateRoot"> |
|||
<Border x:Name="IndeterminateProgressBarIndicator" CornerRadius="{TemplateBinding CornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> |
|||
<Border x:Name="IndeterminateProgressBarIndicator2" CornerRadius="{TemplateBinding CornerRadius}" Margin="{TemplateBinding Padding}" Background="{TemplateBinding Foreground}" /> |
|||
</Panel> |
|||
<LayoutTransformControl x:Name="PART_LayoutTransformControl" HorizontalAlignment="Center" VerticalAlignment="Center" IsVisible="{TemplateBinding ShowProgressText}"> |
|||
<TextBlock Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" Text="{ReflectionBinding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:0}%}" /> |
|||
</LayoutTransformControl> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
<Setter Property="VerticalAlignment" Value="Stretch" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical /template/ Border#PART_Indicator"> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal"> |
|||
<Setter Property="MinWidth" Value="200" /> |
|||
<Setter Property="MinHeight" Value="4" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical"> |
|||
<Setter Property="MinWidth" Value="4" /> |
|||
<Setter Property="MinHeight" Value="200" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical /template/ LayoutTransformControl#PART_LayoutTransformControl"> |
|||
<Setter Property="LayoutTransform"> |
|||
<Setter.Value> |
|||
<RotateTransform Angle="90" /> |
|||
</Setter.Value> |
|||
</Setter> |
|||
</Style> |
|||
<!-- FadeInAnimation mockup--> |
|||
<Style Selector="ProgressBar /template/ Panel#DeterminateRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="ProgressBar /template/ Panel#IndeterminateRoot"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.197" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="ProgressBar /template/ Panel#DeterminateRoot"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar /template/ Panel#IndeterminateRoot"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:indeterminate /template/ Panel#DeterminateRoot"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:indeterminate /template/ Panel#IndeterminateRoot"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:2" IterationCount="Infinite"> |
|||
<KeyFrame KeyTime="0:0:0" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:1.5" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:2" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal:indeterminate /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:2" IterationCount="Infinite"> |
|||
<KeyFrame KeyTime="0:0:0" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:0.75" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:2" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:2" IterationCount="Infinite"> |
|||
<KeyFrame KeyTime="0:0:0" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:1.5" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:2" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical:indeterminate /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Style.Animations> |
|||
<Animation Duration="0:0:2" IterationCount="Infinite"> |
|||
<KeyFrame KeyTime="0:0:0" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:0.75" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeyTime="0:0:2" KeySpline="0.4,0,0.6,1"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:horizontal /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2Width}" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="ProgressBar:vertical /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2Width}" /> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="10"> |
|||
<ProgressBar VerticalAlignment="Center" IsIndeterminate="True" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="5" Maximum="10" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="50" /> |
|||
<ProgressBar VerticalAlignment="Center" Value="50" Minimum="25" Maximum="75" /> |
|||
<ProgressBar HorizontalAlignment="Left" IsIndeterminate="True" Orientation="Vertical" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<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> |
|||
<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}" |
|||
Text="{ReflectionBinding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:0}%}" /> |
|||
</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].TemplateProperties.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.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].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.X" Value="{Binding $parent[ProgressBar].TemplateProperties.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].TemplateProperties.ContainerAnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:1.5"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerAnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.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].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:0.75"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationStartPosition}" /> |
|||
</KeyFrame> |
|||
<KeyFrame KeySpline="0.4,0,0.6,1" KeyTime="0:0:2"> |
|||
<Setter Property="TranslateTransform.Y" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2AnimationEndPosition}" /> |
|||
</KeyFrame> |
|||
</Animation> |
|||
</Style.Animations> |
|||
</Style> |
|||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="^:horizontal /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Width" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2Width}" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateProperties.ContainerWidth}" /> |
|||
</Style> |
|||
<Style Selector="^:vertical /template/ Border#IndeterminateProgressBarIndicator2"> |
|||
<Setter Property="Height" Value="{Binding $parent[ProgressBar].TemplateProperties.Container2Width}" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,63 +1,65 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<RepeatButton Content="Click Me!" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Styles.Resources> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<RepeatButton Content="Click Me!" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<Thickness x:Key="ButtonPadding">8,5,8,6</Thickness> |
|||
</Styles.Resources> |
|||
<Style Selector="RepeatButton"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackground}" /> |
|||
<!--<Setter Property="BackgroundSizing" Value="OuterBorderEdge" />--> |
|||
<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="FontWeight" Value="Normal" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<!--<Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> |
|||
<Setter Property="FocusVisualMargin" Value="-3" />--> |
|||
<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> |
|||
|
|||
<Style Selector="RepeatButton /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
<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="FontWeight" Value="Normal" /> |
|||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<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="RepeatButton: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="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="RepeatButton: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="^: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="RepeatButton:disabled /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Background" Value="{DynamicResource RepeatButtonBackgroundDisabled}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource RepeatButtonBorderBrushDisabled}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource RepeatButtonForegroundDisabled}" /> |
|||
</Style> |
|||
</Styles> |
|||
<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> |
|||
|
|||
<Style Selector="^:pressed"> |
|||
<Setter Property="RenderTransform" Value="scale(0.98)" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,160 +1,87 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Grid ColumnDefinitions="*,20,*" |
|||
Height="300" |
|||
Width="200" |
|||
Margin="20"> |
|||
<ScrollViewer> |
|||
<Border Height="1000" Background="#ccc"/> |
|||
</ScrollViewer> |
|||
<ScrollViewer Grid.Column="2" Classes="menuscroller"> |
|||
<Border Height="1000" Background="#ccc"/> |
|||
</ScrollViewer> |
|||
</Grid> |
|||
</Design.PreviewWith> |
|||
<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"> |
|||
<Design.PreviewWith> |
|||
<Grid ColumnDefinitions="*,20,*" Height="300" Width="200" Margin="20"> |
|||
<ScrollViewer> |
|||
<Border Height="1000" Background="#ccc" /> |
|||
</ScrollViewer> |
|||
<ScrollViewer Grid.Column="2" Classes="menuscroller"> |
|||
<Border Height="1000" Background="#ccc" /> |
|||
</ScrollViewer> |
|||
</Grid> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style Selector="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" |
|||
Grid.RowSpan="2" |
|||
Grid.ColumnSpan="2" |
|||
Background="{TemplateBinding Background}" |
|||
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" |
|||
CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" |
|||
Content="{TemplateBinding Content}" |
|||
Extent="{TemplateBinding Extent, Mode=TwoWay}" |
|||
Padding="{TemplateBinding Padding}" |
|||
Offset="{TemplateBinding Offset, Mode=TwoWay}" |
|||
Viewport="{TemplateBinding Viewport, Mode=TwoWay}" |
|||
IsScrollChainingEnabled="{TemplateBinding IsScrollChainingEnabled}"> |
|||
<ScrollContentPresenter.GestureRecognizers> |
|||
<ScrollGestureRecognizer |
|||
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" |
|||
CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" /> |
|||
</ScrollContentPresenter.GestureRecognizers> |
|||
</ScrollContentPresenter> |
|||
<ScrollBar Name="PART_HorizontalScrollBar" |
|||
AllowAutoHide="{TemplateBinding AllowAutoHide}" |
|||
Orientation="Horizontal" |
|||
LargeChange="{Binding LargeChange.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|||
SmallChange="{Binding SmallChange.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|||
Maximum="{TemplateBinding HorizontalScrollBarMaximum}" |
|||
Value="{TemplateBinding HorizontalScrollBarValue, Mode=TwoWay}" |
|||
ViewportSize="{TemplateBinding HorizontalScrollBarViewportSize}" |
|||
Visibility="{TemplateBinding HorizontalScrollBarVisibility}" |
|||
Grid.Row="1" |
|||
Focusable="False" /> |
|||
<ScrollBar Name="PART_VerticalScrollBar" |
|||
AllowAutoHide="{TemplateBinding AllowAutoHide}" |
|||
Orientation="Vertical" |
|||
LargeChange="{Binding LargeChange.Height, RelativeSource={RelativeSource TemplatedParent}}" |
|||
SmallChange="{Binding SmallChange.Height, RelativeSource={RelativeSource TemplatedParent}}" |
|||
Maximum="{TemplateBinding VerticalScrollBarMaximum}" |
|||
Value="{TemplateBinding VerticalScrollBarValue, Mode=TwoWay}" |
|||
ViewportSize="{TemplateBinding VerticalScrollBarViewportSize}" |
|||
Visibility="{TemplateBinding VerticalScrollBarVisibility}" |
|||
Grid.Column="1" |
|||
Focusable="False" /> |
|||
<Panel x:Name="PART_ScrollBarsSeparator" Grid.Row="1" Grid.Column="1" Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="ScrollViewer /template/ Panel#PART_ScrollBarsSeparator"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="ScrollViewer[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ScrollViewer.menuscroller"> |
|||
<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" |
|||
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" |
|||
Width="20" |
|||
Height="20" /> |
|||
</Viewbox> |
|||
</RepeatButton> |
|||
<ScrollContentPresenter Name="PART_ContentPresenter" |
|||
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" |
|||
CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" |
|||
Content="{TemplateBinding Content}" |
|||
Extent="{TemplateBinding Extent, Mode=TwoWay}" |
|||
Margin="{TemplateBinding Padding}" |
|||
Offset="{TemplateBinding Offset, Mode=TwoWay}" |
|||
Viewport="{TemplateBinding Viewport, Mode=TwoWay}"/> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="ScrollViewer.menuscroller /template/ RepeatButton > Viewbox > Path"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForeground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="ScrollViewer.menuscroller /template/ RepeatButton:pointerover > Viewbox > Path"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}" /> |
|||
</Style> |
|||
|
|||
</Styles> |
|||
<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" Grid.RowSpan="2" Grid.ColumnSpan="2" Background="{TemplateBinding Background}" CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" Content="{TemplateBinding Content}" Extent="{TemplateBinding Extent, Mode=TwoWay}" Padding="{TemplateBinding Padding}" Offset="{TemplateBinding Offset, Mode=TwoWay}" Viewport="{TemplateBinding Viewport, Mode=TwoWay}" IsScrollChainingEnabled="{TemplateBinding IsScrollChainingEnabled}"> |
|||
<ScrollContentPresenter.GestureRecognizers> |
|||
<ScrollGestureRecognizer CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" /> |
|||
</ScrollContentPresenter.GestureRecognizers> |
|||
</ScrollContentPresenter> |
|||
<ScrollBar Name="PART_HorizontalScrollBar" AllowAutoHide="{TemplateBinding AllowAutoHide}" Orientation="Horizontal" LargeChange="{Binding LargeChange.Width, RelativeSource={RelativeSource TemplatedParent}}" SmallChange="{Binding SmallChange.Width, RelativeSource={RelativeSource TemplatedParent}}" Maximum="{TemplateBinding HorizontalScrollBarMaximum}" Value="{TemplateBinding HorizontalScrollBarValue, Mode=TwoWay}" ViewportSize="{TemplateBinding HorizontalScrollBarViewportSize}" Visibility="{TemplateBinding HorizontalScrollBarVisibility}" Grid.Row="1" Focusable="False" /> |
|||
<ScrollBar Name="PART_VerticalScrollBar" AllowAutoHide="{TemplateBinding AllowAutoHide}" Orientation="Vertical" LargeChange="{Binding LargeChange.Height, RelativeSource={RelativeSource TemplatedParent}}" SmallChange="{Binding SmallChange.Height, RelativeSource={RelativeSource TemplatedParent}}" Maximum="{TemplateBinding VerticalScrollBarMaximum}" Value="{TemplateBinding VerticalScrollBarValue, Mode=TwoWay}" ViewportSize="{TemplateBinding VerticalScrollBarViewportSize}" Visibility="{TemplateBinding VerticalScrollBarVisibility}" Grid.Column="1" Focusable="False" /> |
|||
<Panel x:Name="PART_ScrollBarsSeparator" Grid.Row="1" Grid.Column="1" Background="{DynamicResource ScrollViewerScrollBarsSeparatorBackground}" /> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^ /template/ Panel#PART_ScrollBarsSeparator"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Opacity" Duration="0:0:0.1" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^[IsExpanded=true] /template/ Panel#PART_ScrollBarsSeparator"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
<Style Selector="^.menuscroller"> |
|||
<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" 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" Width="20" Height="20" /> |
|||
</Viewbox> |
|||
</RepeatButton> |
|||
<ScrollContentPresenter Name="PART_ContentPresenter" CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}" CanVerticallyScroll="{TemplateBinding CanVerticallyScroll}" Content="{TemplateBinding Content}" Extent="{TemplateBinding Extent, Mode=TwoWay}" Margin="{TemplateBinding Padding}" Offset="{TemplateBinding Offset, Mode=TwoWay}" Viewport="{TemplateBinding Viewport, Mode=TwoWay}" /> |
|||
</DockPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Style Selector="^ /template/ RepeatButton"> |
|||
<Style Selector="^ > Viewbox > Path"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForeground}" /> |
|||
</Style> |
|||
<Style Selector="^:pointerover > Viewbox > Path"> |
|||
<Setter Property="Fill" Value="{DynamicResource ScrollBarButtonArrowForegroundPointerOver}" /> |
|||
</Style> |
|||
</Style> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,65 +1,63 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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> |
|||
|
|||
<Styles.Resources> |
|||
<Thickness x:Key="TabControlTopPlacementItemMargin">0 0 0 2</Thickness> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
DockPanel.Dock="{TemplateBinding TabStripPlacement}"/> |
|||
<ContentPresenter Name="PART_SelectedContentHost" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding SelectedContent}" |
|||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" /> |
|||
</DockPanel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="TabControl[TabStripPlacement=Left] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel"> |
|||
<Setter Property="Orientation" Value="Vertical" /> |
|||
</Style> |
|||
<Style Selector="TabControl[TabStripPlacement=Right] /template/ ItemsPresenter#PART_ItemsPresenter > WrapPanel"> |
|||
<Setter Property="Orientation" Value="Vertical" /> |
|||
</Style> |
|||
<Style Selector="TabControl[TabStripPlacement=Top] /template/ ItemsPresenter#PART_ItemsPresenter"> |
|||
<Setter Property="Margin" Value="{DynamicResource TabControlTopPlacementItemMargin}" /> |
|||
</Style> |
|||
</Styles> |
|||
<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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" |
|||
DockPanel.Dock="{TemplateBinding TabStripPlacement}" /> |
|||
<ContentPresenter Name="PART_SelectedContentHost" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding SelectedContent}" |
|||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" /> |
|||
</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> |
|||
|
|||
@ -1,132 +1,133 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabItem Header="Leaf" /> |
|||
<TabItem Header="Arch" IsSelected="True" /> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Styles.Resources> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabItem Header="Leaf" /> |
|||
<TabItem Header="Arch" IsSelected="True" /> |
|||
</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> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="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" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Panel> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
Content="{TemplateBinding Header}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontWeight="{TemplateBinding FontWeight}" /> |
|||
<Border Name="PART_SelectedPipe" |
|||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<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" |
|||
Padding="{TemplateBinding Padding}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Panel> |
|||
<ContentPresenter |
|||
Name="PART_ContentPresenter" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Header}" |
|||
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontWeight="{TemplateBinding FontWeight}" /> |
|||
<Border Name="PART_SelectedPipe" Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<!-- Nornal state --> |
|||
<Style Selector="TabItem /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{Binding $parent[TabItem].Background}" /> |
|||
</Style> |
|||
<Style Selector="TabItem /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
<!-- Nornal state --> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{Binding $parent[TabItem].Background}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background --> |
|||
<Style Selector="TabItem:selected"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="TabItem:selected /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" 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="TabItem:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|||
</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="TabItem:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPointerOver}" /> |
|||
</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="TabItem:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|||
</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="TabItem:selected:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" /> |
|||
</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="TabItem:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" /> |
|||
</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="TabItem[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="TabItem[TabStripPlacement=Left] /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="8,0,0,0" /> |
|||
</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="TabItem[TabStripPlacement=Top] /template/ Border#PART_SelectedPipe, TabItem[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=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="TabItem[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="TabItem[TabStripPlacement=Right] /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="0,0,8,0" /> |
|||
</Style> |
|||
<Style Selector="TabItem[TabStripPlacement=Right]"> |
|||
<Setter Property="HorizontalContentAlignment" Value="Right" /> |
|||
</Style> |
|||
</Styles> |
|||
<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> |
|||
|
|||
@ -1,32 +1,34 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<TabStrip> |
|||
<TabStripItem>Item 1</TabStripItem> |
|||
<TabStripItem>Item 2</TabStripItem> |
|||
<TabStripItem IsEnabled="False">Disabled</TabStripItem> |
|||
</TabStrip> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ItemsPanel"> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel /> |
|||
</ItemsPanelTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<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" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
ItemTemplate="{TemplateBinding ItemTemplate}" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
<Setter Property="ItemsPanel"> |
|||
<ItemsPanelTemplate> |
|||
<WrapPanel /> |
|||
</ItemsPanelTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,107 +1,108 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabStripItem>Leaf</TabStripItem> |
|||
<TabStripItem IsSelected="True">Arch</TabStripItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Styles.Resources> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Border Padding="20"> |
|||
<StackPanel Spacing="20"> |
|||
<TabStripItem>Leaf</TabStripItem> |
|||
<TabStripItem IsSelected="True">Arch</TabStripItem> |
|||
</StackPanel> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<x:Double x:Key="TabStripItemMinHeight">48</x:Double> |
|||
<x:Double x:Key="TabStripItemPipeThickness">2</x:Double> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="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" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}" |
|||
Padding="{TemplateBinding Padding}"> |
|||
<Panel> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontWeight="{TemplateBinding FontWeight}" /> |
|||
<Border Name="PART_SelectedPipe" |
|||
Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<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" |
|||
Padding="{TemplateBinding Padding}" |
|||
BorderBrush="{TemplateBinding BorderBrush}" |
|||
BorderThickness="{TemplateBinding BorderThickness}" |
|||
CornerRadius="{TemplateBinding CornerRadius}"> |
|||
<Panel> |
|||
<ContentPresenter |
|||
Name="PART_ContentPresenter" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
FontFamily="{TemplateBinding FontFamily}" |
|||
FontSize="{TemplateBinding FontSize}" |
|||
FontWeight="{TemplateBinding FontWeight}" /> |
|||
<Border Name="PART_SelectedPipe" Background="{DynamicResource TabItemHeaderSelectedPipeFill}" /> |
|||
</Panel> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="TabStripItem /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
|||
</Style> |
|||
|
|||
<!-- Nornal state --> |
|||
<Style Selector="TabStripItem /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{Binding $parent[TabStripItem].Background}" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem /template/ Border#PART_SelectedPipe, TabItem[TabStripPlacement=Bottom] /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="Height" Value="{DynamicResource TabStripItemPipeThickness}" /> |
|||
<Setter Property="Margin" Value="0,0,0,2" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
</Style> |
|||
<!-- Nornal state --> |
|||
<Style Selector="^ /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{Binding $parent[TabStripItem].Background}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="Height" Value="{DynamicResource TabStripItemPipeThickness}" /> |
|||
<Setter Property="Margin" Value="0,0,0,2" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
</Style> |
|||
|
|||
<!-- Selected state --> |
|||
<!-- We don't use selector to PART_LayoutRoot, so developer can override selected item background with TabStripItem.Background --> |
|||
<Style Selector="TabStripItem:selected"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelected}" /> |
|||
<Setter Property="Foreground" Value="{DynamicResource TabItemHeaderForegroundSelected}" /> |
|||
</Style> |
|||
<Style Selector="TabStripItem:selected /template/ Border#PART_SelectedPipe"> |
|||
<Setter Property="IsVisible" 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="TabStripItem:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPointerOver}" /> |
|||
</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="TabStripItem:selected:pointerover /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPointerOver}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPointerOver}" /> |
|||
</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="TabStripItem:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundUnselectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundUnselectedPressed}" /> |
|||
</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="TabStripItem:selected:pressed /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundSelectedPressed}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundSelectedPressed}" /> |
|||
</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="TabStripItem:disabled /template/ Border#PART_LayoutRoot"> |
|||
<Setter Property="Background" Value="{DynamicResource TabItemHeaderBackgroundDisabled}" /> |
|||
<Setter Property="TextElement.Foreground" Value="{DynamicResource TabItemHeaderForegroundDisabled}" /> |
|||
</Style> |
|||
</Styles> |
|||
<!-- 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> |
|||
|
|||
@ -1,53 +1,55 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border> |
|||
<TitleBar Background="SkyBlue" Height="30" Width="300" Foreground="Black" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
<Style Selector="TitleBar"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Stretch"> |
|||
<Panel x:Name="PART_MouseTracker" Height="1" VerticalAlignment="Top" /> |
|||
<Panel x:Name="PART_Container"> |
|||
<Border x:Name="PART_Background" Background="{TemplateBinding Background}" /> |
|||
<CaptionButtons x:Name="PART_CaptionButtons" VerticalAlignment="Top" HorizontalAlignment="Right" Foreground="{TemplateBinding Foreground}" /> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Design.PreviewWith> |
|||
<Border> |
|||
<TitleBar Background="SkyBlue" Height="30" Width="300" Foreground="Black" /> |
|||
</Border> |
|||
</Design.PreviewWith> |
|||
|
|||
<ControlTheme x:Key="{x:Type TitleBar}" TargetType="TitleBar"> |
|||
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Panel HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="Stretch"> |
|||
<Panel x:Name="PART_MouseTracker" Height="1" VerticalAlignment="Top" /> |
|||
<Panel x:Name="PART_Container"> |
|||
<Border x:Name="PART_Background" Background="{TemplateBinding Background}" /> |
|||
<CaptionButtons x:Name="PART_CaptionButtons" VerticalAlignment="Top" HorizontalAlignment="Right" Foreground="{TemplateBinding Foreground}" /> |
|||
</Panel> |
|||
</Panel> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="TitleBar:fullscreen"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemAccentColor}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TitleBar /template/ Border#PART_Background"> |
|||
<Setter Property="IsHitTestVisible" Value="False" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ Border#PART_Background"> |
|||
<Setter Property="IsHitTestVisible" Value="False" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TitleBar:fullscreen /template/ Border#PART_Background"> |
|||
<Setter Property="IsHitTestVisible" Value="True" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Border#PART_Background"> |
|||
<Setter Property="IsHitTestVisible" Value="True" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TitleBar:fullscreen /template/ Panel#PART_MouseTracker"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_MouseTracker"> |
|||
<Setter Property="Background" Value="Transparent" /> |
|||
</Style> |
|||
|
|||
<Style Selector="TitleBar:fullscreen /template/ Panel#PART_Container"> |
|||
<Setter Property="RenderTransform" Value="translateY(-30px)" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.25" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
<Style Selector="^:fullscreen /template/ Panel#PART_Container"> |
|||
<Setter Property="RenderTransform" Value="translateY(-30px)" /> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:.25" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="TitleBar:fullscreen:pointerover /template/ Panel#PART_Container"> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
</Style> |
|||
</Styles> |
|||
<Style Selector="^:fullscreen:pointerover /template/ Panel#PART_Container"> |
|||
<Setter Property="RenderTransform" Value="none" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,288 +1,307 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|||
<Styles.Resources> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|||
<Design.PreviewWith> |
|||
<StackPanel Margin="20" Width="250" Spacing="24" > |
|||
<StackPanel Spacing="12" > |
|||
<TextBlock |
|||
Text="Automatic updates" |
|||
Classes="h1"/> |
|||
<TextBlock |
|||
Text="Updates will be automaticly Downloaded and installed shile the computer is shutting down or restarting" |
|||
TextWrapping="Wrap"/> |
|||
<ToggleSwitch HorizontalContentAlignment="Left" |
|||
Content="Enable automatic Updates?" |
|||
OffContent="Uit" |
|||
OnContent="Aan" |
|||
VerticalAlignment="Bottom"/> |
|||
</StackPanel> |
|||
|
|||
<StackPanel Spacing="12"> |
|||
<TextBlock |
|||
Text="Previewer" |
|||
Classes="h1"/> |
|||
<TextBlock |
|||
Text="The previewer Shows a preview off your code, this could slow down your system" |
|||
TextWrapping="Wrap"/> |
|||
<ToggleSwitch |
|||
Background="Green" |
|||
IsChecked="True" /> |
|||
</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> |
|||
</Styles.Resources> |
|||
<Design.PreviewWith> |
|||
<StackPanel Margin="20" Width="250" Spacing="24" > |
|||
<StackPanel Spacing="12" > |
|||
<TextBlock |
|||
Text="Automatic updates" |
|||
Classes="h1"/> |
|||
<TextBlock |
|||
Text="Updates will be automaticly Downloaded and installed shile the computer is shutting down or restarting" |
|||
TextWrapping="Wrap"/> |
|||
<ToggleSwitch HorizontalContentAlignment="Left" |
|||
Content="Enable automatic Updates?" |
|||
OffContent="Uit" |
|||
OnContent="Aan" |
|||
VerticalAlignment="Bottom"/> |
|||
</StackPanel> |
|||
|
|||
<StackPanel Spacing="12"> |
|||
<TextBlock |
|||
Text="Previewer" |
|||
Classes="h1"/> |
|||
<TextBlock |
|||
Text="The previewer Shows a preview off your code, this could slow down your system" |
|||
TextWrapping="Wrap"/> |
|||
<ToggleSwitch |
|||
Background="Green" |
|||
IsChecked="True" /> |
|||
</StackPanel> |
|||
</StackPanel> |
|||
</Design.PreviewWith> |
|||
|
|||
<Style Selector="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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<Grid Background="{TemplateBinding Background}" |
|||
RowDefinitions="Auto,*"> |
|||
|
|||
<ContentPresenter x:Name="PART_ContentPresenter" |
|||
Grid.Row="0" |
|||
Content="{TemplateBinding Content}" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
RecognizesAccessKey="True" |
|||
VerticalAlignment="Top"/> |
|||
|
|||
<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" |
|||
TemplatedControl.IsTemplateFocusTarget="True" |
|||
Margin="0,5" /> |
|||
|
|||
<ContentPresenter x:Name="PART_OffContentPresenter" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="2" |
|||
Content="{TemplateBinding OffContent}" |
|||
ContentTemplate="{TemplateBinding OffContentTemplate}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|||
|
|||
<ContentPresenter x:Name="PART_OnContentPresenter" |
|||
Grid.RowSpan="3" |
|||
Grid.Column="2" |
|||
Content="{TemplateBinding OnContent}" |
|||
ContentTemplate="{TemplateBinding OnContentTemplate}" |
|||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|||
|
|||
<Border x:Name="OuterBorder" |
|||
Grid.Row="1" |
|||
Height="20" |
|||
Width="40" |
|||
CornerRadius="10" |
|||
BorderThickness="{DynamicResource ToggleSwitchOuterBorderStrokeThickness}" /> |
|||
|
|||
<Border x:Name="SwitchKnobBounds" |
|||
Grid.Row="1" |
|||
Height="20" |
|||
Width="40" |
|||
CornerRadius="10" |
|||
BorderThickness="{DynamicResource ToggleSwitchOnStrokeThickness}"/> |
|||
|
|||
<Canvas x:Name="SwitchKnob" Grid.Row="1" |
|||
HorizontalAlignment="Left" |
|||
Width="20" Height="20"> |
|||
|
|||
<Grid x:Name="MovingKnobs" |
|||
Width="20" Height="20"> |
|||
|
|||
<Ellipse x:Name="SwitchKnobOn" |
|||
Width="10" Height="10" /> |
|||
|
|||
<Ellipse x:Name="SwitchKnobOff" |
|||
Width="10" Height="10" /> |
|||
</Grid> |
|||
</Canvas> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchTopHeaderMargin}" /> |
|||
</Style> |
|||
<Style Selector="ToggleSwitch /template/ ContentPresenter#PART_ContentPresenter:empty"> |
|||
<Setter Property="Margin" Value="0" /> |
|||
</Style> |
|||
|
|||
<!-- NormalState --> |
|||
<Style Selector="ToggleSwitch /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackground}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch /template/ Border#OuterBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOff}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOff}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOn}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOn}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOn}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOff}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:not(:dragging) /template/ Grid#MovingKnobs"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition Property="Canvas.Left" Duration="0:0:0.2" Easing="CubicEaseOut"/> |
|||
</Transitions> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<!-- PointerOverState --> |
|||
<Style Selector="ToggleSwitch:pointerover /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPointerOver}"/> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPointerOver}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pointerover /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPointerOver}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pointerover /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPointerOver}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pointerover /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPointerOver}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPointerOver}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pointerover /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPointerOver}"/> |
|||
</Style> |
|||
|
|||
<!-- PressedState --> |
|||
<Style Selector="ToggleSwitch:pressed /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffPressed}"/> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pressed /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnPressed}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pressed /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pressed /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnPressed}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:pressed /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackgroundPressed}"/> |
|||
</Style> |
|||
|
|||
<!-- DisabledState --> |
|||
<Style Selector="ToggleSwitch:disabled"> |
|||
<Setter Property="Foreground" Value="{DynamicResource ToggleSwitchHeaderForegroundDisabled}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:disabled /template/ Border#OuterBorder"> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOffDisabled}"/> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOffDisabled}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:disabled /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOffDisabled}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:disabled /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOnDisabled}"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:disabled /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOnDisabled}"/> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOnDisabled}"/> |
|||
</Style> |
|||
|
|||
<!-- CheckedState --> |
|||
<Style Selector="ToggleSwitch:checked /template/ Border#OuterBorder"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:checked /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:checked /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:checked /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:checked /template/ ContentPresenter#PART_OffContentPresenter"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:checked /template/ ContentPresenter#PART_OnContentPresenter"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<!--UncheckedState --> |
|||
<Style Selector="ToggleSwitch:unchecked /template/ Border#OuterBorder"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:unchecked /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:unchecked /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:unchecked /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:unchecked /template/ ContentPresenter#PART_OffContentPresenter"> |
|||
<Setter Property="Opacity" Value="1"/> |
|||
</Style> |
|||
|
|||
<Style Selector="ToggleSwitch:unchecked /template/ ContentPresenter#PART_OnContentPresenter"> |
|||
<Setter Property="Opacity" Value="0"/> |
|||
</Style> |
|||
</Styles> |
|||
|
|||
<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="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|||
<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}" |
|||
RecognizesAccessKey="True" /> |
|||
|
|||
<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" |
|||
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" |
|||
BorderThickness="{DynamicResource ToggleSwitchOuterBorderStrokeThickness}" |
|||
CornerRadius="10" /> |
|||
|
|||
<Border |
|||
x:Name="SwitchKnobBounds" |
|||
Grid.Row="1" |
|||
Width="40" |
|||
Height="20" |
|||
BorderThickness="{DynamicResource ToggleSwitchOnStrokeThickness}" |
|||
CornerRadius="10" /> |
|||
|
|||
<Canvas |
|||
x:Name="SwitchKnob" |
|||
Grid.Row="1" |
|||
Width="20" |
|||
Height="20" |
|||
HorizontalAlignment="Left"> |
|||
|
|||
<Grid |
|||
x:Name="MovingKnobs" |
|||
Width="20" |
|||
Height="20"> |
|||
|
|||
<Ellipse |
|||
x:Name="SwitchKnobOn" |
|||
Width="10" |
|||
Height="10" /> |
|||
|
|||
<Ellipse |
|||
x:Name="SwitchKnobOff" |
|||
Width="10" |
|||
Height="10" /> |
|||
</Grid> |
|||
</Canvas> |
|||
</Grid> |
|||
</Grid> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter"> |
|||
<Setter Property="Margin" Value="{DynamicResource ToggleSwitchTopHeaderMargin}" /> |
|||
</Style> |
|||
<Style Selector="^ /template/ ContentPresenter#PART_ContentPresenter:empty"> |
|||
<Setter Property="Margin" Value="0" /> |
|||
</Style> |
|||
|
|||
<!-- NormalState --> |
|||
<Style Selector="^ /template/ Grid#SwitchAreaGrid"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchContainerBackground}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#OuterBorder"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOff}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOff}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Border#SwitchKnobBounds"> |
|||
<Setter Property="Background" Value="{DynamicResource ToggleSwitchFillOn}" /> |
|||
<Setter Property="BorderBrush" Value="{DynamicResource ToggleSwitchStrokeOn}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Ellipse#SwitchKnobOn"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOn}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^ /template/ Ellipse#SwitchKnobOff"> |
|||
<Setter Property="Fill" Value="{DynamicResource ToggleSwitchKnobFillOff}" /> |
|||
</Style> |
|||
|
|||
<Style Selector="^:not(:dragging) /template/ Grid#MovingKnobs"> |
|||
<Setter Property="Transitions"> |
|||
<Transitions> |
|||
<DoubleTransition |
|||
Easing="CubicEaseOut" |
|||
Property="Canvas.Left" |
|||
Duration="0:0:0.2" /> |
|||
</Transitions> |
|||
</Setter> |
|||
</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> |
|||
|
|||
@ -1,87 +1,71 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|||
x:CompileBindings="True"> |
|||
|
|||
<Design.PreviewWith> |
|||
<Grid RowDefinitions="Auto,Auto" |
|||
ColumnDefinitions="Auto,Auto" |
|||
HorizontalAlignment="Center"> |
|||
<Border Grid.Column="0" |
|||
Grid.Row="1" |
|||
Background="{DynamicResource SystemControlBackgroundAccentBrush}" |
|||
Margin="5" |
|||
Padding="50" |
|||
ToolTip.Tip="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."> |
|||
<TextBlock>Hover Here</TextBlock> |
|||
</Border> |
|||
<CheckBox Grid.Column="1" |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|||
x:CompileBindings="True"> |
|||
<Design.PreviewWith> |
|||
<Grid RowDefinitions="Auto,Auto" |
|||
ColumnDefinitions="Auto,Auto" |
|||
HorizontalAlignment="Center"> |
|||
<Border Grid.Column="0" |
|||
Grid.Row="1" |
|||
Background="{DynamicResource SystemControlBackgroundAccentBrush}" |
|||
Margin="5" Padding="50" ToolTip.Tip="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."> |
|||
<TextBlock>Hover Here</TextBlock> |
|||
</Border> |
|||
<CheckBox Grid.Column="1" |
|||
Margin="5" |
|||
Grid.Row="0" |
|||
IsChecked="{Binding ElementName=Border, Path=(ToolTip.IsOpen)}" |
|||
Content="ToolTip Open" /> |
|||
<Border Name="Border" |
|||
Grid.Column="1" |
|||
Grid.Row="1" |
|||
Background="{DynamicResource SystemControlBackgroundAccentBrush}" |
|||
Margin="5" |
|||
Grid.Row="0" |
|||
IsChecked="{Binding ElementName=Border, Path=(ToolTip.IsOpen)}" |
|||
Content="ToolTip Open" /> |
|||
<Border Name="Border" |
|||
Grid.Column="1" |
|||
Grid.Row="1" |
|||
Background="{DynamicResource SystemControlBackgroundAccentBrush}" |
|||
Margin="5" |
|||
Padding="50" |
|||
ToolTip.Placement="Bottom"> |
|||
<ToolTip.Tip> |
|||
<StackPanel> |
|||
<TextBlock Classes="h1">ToolTip</TextBlock> |
|||
<TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock> |
|||
</StackPanel> |
|||
</ToolTip.Tip> |
|||
<TextBlock>ToolTip bottom placement</TextBlock> |
|||
</Border> |
|||
</Grid> |
|||
</Design.PreviewWith> |
|||
Padding="50" |
|||
ToolTip.Placement="Bottom"> |
|||
<ToolTip.Tip> |
|||
<StackPanel> |
|||
<TextBlock Classes="h1">ToolTip</TextBlock> |
|||
<TextBlock Classes="h2">A control which pops up a hint when a control is hovered</TextBlock> |
|||
</StackPanel> |
|||
</ToolTip.Tip> |
|||
<TextBlock>ToolTip bottom placement</TextBlock> |
|||
</Border> |
|||
</Grid> |
|||
</Design.PreviewWith> |
|||
|
|||
<Styles.Resources> |
|||
<sys:Double x:Key="ToolTipContentMaxWidth">320</sys:Double> |
|||
</Styles.Resources> |
|||
|
|||
<Style Selector="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="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}" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
|
|||
<Style Selector="ToolTip > TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style> |
|||
<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}" /> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
|
|||
<Style Selector="ToolTip"> |
|||
<Setter Property="Opacity" Value="0" /> |
|||
</Style> |
|||
<!--<Style Selector="^ > TextBlock"> |
|||
<Setter Property="TextWrapping" Value="Wrap" /> |
|||
</Style>--> |
|||
|
|||
<Style Selector="ToolTip:open"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
</Styles> |
|||
<Style Selector="^:open"> |
|||
<Setter Property="Opacity" Value="1" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,20 +1,19 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<Style Selector="TransitioningContentControl"> |
|||
<!-- Set Defaults --> |
|||
<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 CurrentContent}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
</Styles> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type TransitioningContentControl}" TargetType="TransitioningContentControl"> |
|||
<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 CurrentContent}" |
|||
Padding="{TemplateBinding Padding}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" /> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,28 +1,31 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" |
|||
Selector="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)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
|
|||
<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)}" |
|||
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"> |
|||
<ItemsPresenter Name="PART_ItemsPresenter" |
|||
Items="{TemplateBinding Items}" |
|||
ItemsPanel="{TemplateBinding ItemsPanel}" |
|||
Margin="{TemplateBinding Padding}" /> |
|||
</ScrollViewer> |
|||
</Border> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
@ -1,16 +1,24 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector=":is(UserControl)"> |
|||
<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 xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
Selector=":is(UserControl)"> |
|||
<Style.Resources> |
|||
<ControlTheme x:Key="FluentUserControl" TargetType="UserControl"> |
|||
<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> |
|||
</ControlTheme> |
|||
</Style.Resources> |
|||
|
|||
<Setter Property="Theme" Value="{StaticResource FluentUserControl}" /> |
|||
</Style> |
|||
|
|||
@ -1,27 +1,30 @@ |
|||
<Style xmlns="https://github.com/avaloniaui" Selector="Window"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="TransparencyBackgroundFallback" 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> |
|||
<VisualLayerManager.ChromeOverlayLayer> |
|||
<TitleBar /> |
|||
</VisualLayerManager.ChromeOverlayLayer> |
|||
<ContentPresenter Name="PART_ContentPresenter" |
|||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|||
Content="{TemplateBinding Content}" |
|||
Margin="{TemplateBinding Padding}" |
|||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/> |
|||
</VisualLayerManager> |
|||
</Panel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
<ControlTheme x:Key="{x:Type Window}" TargetType="Window"> |
|||
<Setter Property="Background" Value="{DynamicResource SystemControlBackgroundAltHighBrush}"/> |
|||
<Setter Property="TransparencyBackgroundFallback" 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> |
|||
<VisualLayerManager.ChromeOverlayLayer> |
|||
<TitleBar /> |
|||
</VisualLayerManager.ChromeOverlayLayer> |
|||
<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> |
|||
|
|||
@ -1,47 +1,58 @@ |
|||
<Styles xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:DataType="WindowNotificationManager" |
|||
x:CompileBindings="True"> |
|||
<Style Selector="WindowNotificationManager"> |
|||
<Setter Property="Margin" Value="0 0"/> |
|||
<Setter Property="Template"> |
|||
<ControlTemplate> |
|||
<ReversibleStackPanel Name="PART_Items"> |
|||
<ReversibleStackPanel.DataTemplates> |
|||
<DataTemplate DataType="INotification"> |
|||
<StackPanel Spacing="8" Margin="12" TextElement.Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}"> |
|||
<TextBlock Text="{Binding Title}" FontWeight="Medium" /> |
|||
<TextBlock MaxHeight="80" Text="{Binding Message}" TextWrapping="Wrap" Margin="0,0,12,0"/> |
|||
</StackPanel> |
|||
</DataTemplate> |
|||
<DataTemplate DataType="x:String"> |
|||
<TextBlock Text="{Binding }" Margin="12" Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" /> |
|||
</DataTemplate> |
|||
</ReversibleStackPanel.DataTemplates> |
|||
</ReversibleStackPanel> |
|||
</ControlTemplate> |
|||
</Setter> |
|||
</Style> |
|||
<ResourceDictionary |
|||
xmlns="https://github.com/avaloniaui" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|||
x:CompileBindings="True" |
|||
x:DataType="WindowNotificationManager"> |
|||
<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="WindowNotificationManager:topleft /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top"/> |
|||
<Setter Property="HorizontalAlignment" Value="Left"/> |
|||
</Style> |
|||
<Style Selector="^:topleft /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Left" /> |
|||
</Style> |
|||
|
|||
<Style Selector="WindowNotificationManager:topright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top"/> |
|||
<Setter Property="HorizontalAlignment" Value="Right"/> |
|||
</Style> |
|||
<Style Selector="^:topright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="VerticalAlignment" Value="Top" /> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
</Style> |
|||
|
|||
<Style Selector="WindowNotificationManager:bottomleft /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True"/> |
|||
<Setter Property="VerticalAlignment" Value="Bottom"/> |
|||
<Setter Property="HorizontalAlignment" Value="Left"/> |
|||
</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="WindowNotificationManager:bottomright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True"/> |
|||
<Setter Property="VerticalAlignment" Value="Bottom"/> |
|||
<Setter Property="HorizontalAlignment" Value="Right"/> |
|||
</Style> |
|||
</Styles> |
|||
<Style Selector="^:bottomright /template/ ReversibleStackPanel#PART_Items"> |
|||
<Setter Property="ReverseOrder" Value="True" /> |
|||
<Setter Property="VerticalAlignment" Value="Bottom" /> |
|||
<Setter Property="HorizontalAlignment" Value="Right" /> |
|||
</Style> |
|||
</ControlTheme> |
|||
</ResourceDictionary> |
|||
|
|||
Loading…
Reference in new issue