Browse Source
Merge pull request #7388 from AvaloniaUI/compiledbindings-themes
Use CompiledBindings for Fluent theme
pull/7405/head
Max Katz
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with
44 additions and
24 deletions
-
src/Avalonia.Themes.Fluent/Controls/ButtonSpinner.xaml
-
src/Avalonia.Themes.Fluent/Controls/CalendarDatePicker.xaml
-
src/Avalonia.Themes.Fluent/Controls/CalendarItem.xaml
-
src/Avalonia.Themes.Fluent/Controls/DataValidationErrors.xaml
-
src/Avalonia.Themes.Fluent/Controls/DatePicker.xaml
-
src/Avalonia.Themes.Fluent/Controls/Expander.xaml
-
src/Avalonia.Themes.Fluent/Controls/ManagedFileChooser.xaml
-
src/Avalonia.Themes.Fluent/Controls/MenuItem.xaml
-
src/Avalonia.Themes.Fluent/Controls/NativeMenuBar.xaml
-
src/Avalonia.Themes.Fluent/Controls/ProgressBar.xaml
-
src/Avalonia.Themes.Fluent/Controls/TabItem.xaml
-
src/Avalonia.Themes.Fluent/Controls/TabStripItem.xaml
-
src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
-
src/Avalonia.Themes.Fluent/Controls/TimePicker.xaml
-
src/Avalonia.Themes.Fluent/Controls/ToolTip.xaml
-
src/Avalonia.Themes.Fluent/Controls/WindowNotificationManager.xaml
|
|
|
@ -1,7 +1,8 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls"> |
|
|
|
xmlns:converters="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20" |
|
|
|
Background="Black"> |
|
|
|
|
|
|
|
@ -7,7 +7,8 @@ |
|
|
|
|
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Margin="20, 20, 20, 200"> |
|
|
|
<CalendarDatePicker Width="200" |
|
|
|
|
|
|
|
@ -6,7 +6,9 @@ |
|
|
|
--> |
|
|
|
|
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:CompileBindings="True" |
|
|
|
x:DataType="CalendarItem"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<Calendar /> |
|
|
|
|
|
|
|
@ -1,6 +1,8 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="using:System"> |
|
|
|
xmlns:sys="using:System" |
|
|
|
x:CompileBindings="True" |
|
|
|
x:DataType="DataValidationErrors"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<StackPanel Spacing="20"> |
|
|
|
@ -27,7 +29,7 @@ |
|
|
|
<Style Selector="DataValidationErrors"> |
|
|
|
<Style.Resources> |
|
|
|
<DataTemplate x:Key="InlineDataValidationErrorTemplate"> |
|
|
|
<ItemsControl Items="{Binding}" TextBlock.Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
|
|
|
<ItemsControl Items="{Binding}" x:DataType="DataValidationErrors" TextBlock.Foreground="{DynamicResource SystemControlErrorTextForegroundBrush}"> |
|
|
|
<ItemsControl.Styles> |
|
|
|
<Style Selector="TextBlock"> |
|
|
|
<Setter Property="TextWrapping" Value="Wrap" /> |
|
|
|
@ -54,7 +56,7 @@ |
|
|
|
</DockPanel> |
|
|
|
</ControlTemplate> |
|
|
|
|
|
|
|
<DataTemplate x:Key="TooltipDataValidationErrorTemplate"> |
|
|
|
<DataTemplate x:DataType="DataValidationErrors" x:Key="TooltipDataValidationErrorTemplate"> |
|
|
|
<Panel Name="PART_InlineErrorTemplatePanel" Background="Transparent"> |
|
|
|
<Panel.Styles> |
|
|
|
<Style Selector="Panel#PART_InlineErrorTemplatePanel"> |
|
|
|
|
|
|
|
@ -7,7 +7,8 @@ |
|
|
|
|
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<DatePicker CornerRadius="10" /> |
|
|
|
|
|
|
|
@ -1,4 +1,6 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<StackPanel Orientation="Vertical" Spacing="20" Width="350"> |
|
|
|
@ -69,13 +71,13 @@ |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}" |
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
|
|
|
IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" |
|
|
|
IsEnabled="{TemplateBinding IsEnabled}" /> |
|
|
|
<Border x:Name="ExpanderContent" |
|
|
|
Padding="{DynamicResource ExpanderContentPadding}" |
|
|
|
Background="{DynamicResource ExpanderDropDownBackground}" |
|
|
|
BorderBrush="{DynamicResource ExpanderDropDownBorderBrush}" |
|
|
|
IsVisible="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"> |
|
|
|
IsVisible="{TemplateBinding IsExpanded, Mode=TwoWay}"> |
|
|
|
<ContentPresenter x:Name="PART_ContentPresenter" |
|
|
|
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
|
|
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
|
|
|
|
|
|
@ -142,7 +142,7 @@ |
|
|
|
<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="{Binding $parent[Button].Foreground}" StrokeThickness="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,1,0,-1"/> |
|
|
|
<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> |
|
|
|
@ -321,4 +321,4 @@ |
|
|
|
<Style Selector="dialogs|ManagedFileChooser /template/ UniformGrid#Finalize > Button /template/ ContentPresenter#PART_ContentPresenter"> |
|
|
|
<Setter Property="HorizontalAlignment" Value="Stretch"/> |
|
|
|
</Style> |
|
|
|
</Styles> |
|
|
|
</Styles> |
|
|
|
|
|
|
|
@ -1,7 +1,9 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:conv="clr-namespace:Avalonia.Controls.Converters;assembly=Avalonia.Controls" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
x:DataType="MenuItem" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20" |
|
|
|
Width="400" |
|
|
|
@ -158,7 +160,7 @@ |
|
|
|
</ContentPresenter> |
|
|
|
<Popup Name="PART_Popup" |
|
|
|
WindowManagerAddShadowHint="False" |
|
|
|
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
MinWidth="{ReflectionBinding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}" |
|
|
|
IsLightDismissEnabled="True" |
|
|
|
IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}" |
|
|
|
OverlayInputPassThroughElement="{Binding $parent[Menu]}"> |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
<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="AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter" Default="True"/> |
|
|
|
@ -11,7 +12,7 @@ |
|
|
|
IsVisible="{Binding $parent[TopLevel].(NativeMenu.IsNativeMenuExported), Converter={StaticResource AvaloniaThemesDefaultNativeMenuBarInverseBooleanValueConverter}}" |
|
|
|
Items="{Binding $parent[TopLevel].(NativeMenu.Menu).Items}"> |
|
|
|
<Menu.Styles> |
|
|
|
<Style Selector="MenuItem"> |
|
|
|
<Style x:DataType="NativeMenuItem" Selector="MenuItem"> |
|
|
|
<Setter Property="Header" Value="{Binding Header}"/> |
|
|
|
<Setter Property="InputGesture" Value="{Binding Gesture}"/> |
|
|
|
<Setter Property="Items" Value="{Binding Menu.Items}"/> |
|
|
|
|
|
|
|
@ -1,4 +1,6 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
<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"> |
|
|
|
@ -29,8 +31,8 @@ |
|
|
|
<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="{Binding ShowProgressText, RelativeSource={RelativeSource TemplatedParent}}"> |
|
|
|
<TextBlock Foreground="{DynamicResource SystemControlForegroundBaseHighBrush}" Text="{Binding Value, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0:0}%}" /> |
|
|
|
<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> |
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<StackPanel Spacing="20"> |
|
|
|
|
|
|
|
@ -1,5 +1,6 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Design.PreviewWith> |
|
|
|
<Border Padding="20"> |
|
|
|
<StackPanel Spacing="20"> |
|
|
|
|
|
|
|
@ -166,7 +166,7 @@ |
|
|
|
<Setter Property="InnerRightContent"> |
|
|
|
<Template> |
|
|
|
<ToggleButton Classes="passwordBoxRevealButton" |
|
|
|
IsChecked="{Binding $parent[TextBox].RevealPassword, Mode=TwoWay}" /> |
|
|
|
IsChecked="{CompiledBinding $parent[TextBox].RevealPassword, Mode=TwoWay}" /> |
|
|
|
</Template> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
|
|
|
|
@ -7,7 +7,8 @@ |
|
|
|
|
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
x:CompileBindings="True"> |
|
|
|
<Styles.Resources> |
|
|
|
<x:Double x:Key="TimePickerFlyoutPresenterItemHeight">40</x:Double> |
|
|
|
<x:Double x:Key="TimePickerSpacerThemeWidth">1</x:Double> |
|
|
|
|
|
|
|
@ -1,6 +1,7 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard"> |
|
|
|
xmlns:sys="clr-namespace:System;assembly=netstandard" |
|
|
|
x:CompileBindings="True"> |
|
|
|
|
|
|
|
<Design.PreviewWith> |
|
|
|
<Grid RowDefinitions="Auto,Auto" |
|
|
|
|
|
|
|
@ -1,5 +1,7 @@ |
|
|
|
<Styles xmlns="https://github.com/avaloniaui" |
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|
|
|
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"> |
|
|
|
|