committed by
GitHub
39 changed files with 971 additions and 395 deletions
@ -1,66 +1,36 @@ |
|||||
<UserControl xmlns="https://github.com/avaloniaui" |
<UserControl xmlns="https://github.com/avaloniaui" |
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||
x:Class="ControlCatalog.Pages.ViewboxPage"> |
x:Class="ControlCatalog.Pages.ViewboxPage"> |
||||
<UserControl.Resources> |
|
||||
<StreamGeometry x:Key="Acorn"> |
|
||||
F1 M 16.6309,18.6563C 17.1309, |
|
||||
8.15625 29.8809,14.1563 29.8809, |
|
||||
14.1563C 30.8809,11.1563 34.1308, |
|
||||
11.4063 34.1308,11.4063C 33.5,12 |
|
||||
34.6309,13.1563 34.6309,13.1563C |
|
||||
32.1309,13.1562 31.1309,14.9062 |
|
||||
31.1309,14.9062C 41.1309,23.9062 |
|
||||
32.6309,27.9063 32.6309,27.9062C |
|
||||
24.6309,24.9063 21.1309,22.1562 |
|
||||
16.6309,18.6563 Z M 16.6309,19.9063C |
|
||||
21.6309,24.1563 25.1309,26.1562 |
|
||||
31.6309,28.6562C 31.6309,28.6562 |
|
||||
26.3809,39.1562 18.3809,36.1563C |
|
||||
18.3809,36.1563 18,38 16.3809,36.9063C |
|
||||
15,36 16.3809,34.9063 16.3809,34.9063C |
|
||||
16.3809,34.9063 10.1309,30.9062 16.6309,19.9063 Z |
|
||||
</StreamGeometry> |
|
||||
</UserControl.Resources> |
|
||||
|
|
||||
<Grid RowDefinitions="Auto,*"> |
<Grid RowDefinitions="Auto,*,*"> |
||||
<StackPanel Orientation="Vertical" Spacing="4"> |
<StackPanel Orientation="Vertical" Spacing="4"> |
||||
<TextBlock Classes="h1">Viewbox</TextBlock> |
<TextBlock Classes="h1">Viewbox</TextBlock> |
||||
<TextBlock Classes="h2">A control used to scale single child.</TextBlock> |
<TextBlock Classes="h2">A control used to scale single child.</TextBlock> |
||||
</StackPanel> |
</StackPanel> |
||||
<Grid ColumnDefinitions="Auto,*,*" |
|
||||
RowDefinitions="*,*,*,*" |
|
||||
Grid.Row="1" Margin="48" |
|
||||
MaxWidth="400"> |
|
||||
<TextBlock Grid.Row="0" VerticalAlignment="Center">None</TextBlock> |
|
||||
<TextBlock Grid.Row="1" VerticalAlignment="Center">Fill</TextBlock> |
|
||||
<TextBlock Grid.Row="2" VerticalAlignment="Center">Uniform</TextBlock> |
|
||||
<TextBlock Grid.Row="3" VerticalAlignment="Center">UniformToFill</TextBlock> |
|
||||
|
|
||||
<Viewbox Grid.Row="0" Grid.Column="1" Stretch="None"> |
<Grid Grid.Row="1" ColumnDefinitions="*,Auto" HorizontalAlignment="Center" Margin="0,10,0,0"> |
||||
<TextBlock>Hello World!</TextBlock> |
|
||||
</Viewbox> |
|
||||
<Viewbox Grid.Row="1" Grid.Column="1" Stretch="Fill"> |
|
||||
<TextBlock>Hello World!</TextBlock> |
|
||||
</Viewbox> |
|
||||
<Viewbox Grid.Row="2" Grid.Column="1" Stretch="Uniform"> |
|
||||
<TextBlock>Hello World!</TextBlock> |
|
||||
</Viewbox> |
|
||||
<Viewbox Grid.Row="3" Grid.Column="1" Stretch="UniformToFill"> |
|
||||
<TextBlock>Hello World!</TextBlock> |
|
||||
</Viewbox> |
|
||||
|
|
||||
<Viewbox Grid.Row="0" Grid.Column="2" Stretch="None"> |
<Border HorizontalAlignment="Center" Grid.Column="0" BorderThickness="1" BorderBrush="Orange" Width="200" Height="200"> |
||||
<Path Fill="Blue" Data="{StaticResource Acorn}"/> |
<Border VerticalAlignment="Center" HorizontalAlignment="Center" Grid.Column="0" BorderThickness="1" BorderBrush="CornflowerBlue" Width="{Binding #WidthSlider.Value}" Height="{Binding #HeightSlider.Value}" > |
||||
</Viewbox> |
<Viewbox |
||||
<Viewbox Grid.Row="1" Grid.Column="2" Stretch="Fill"> |
Stretch="{Binding #StretchSelector.SelectedItem}" |
||||
<Path Fill="Blue" Data="{StaticResource Acorn}"/> |
StretchDirection="{Binding #StretchDirectionSelector.SelectedItem}"> |
||||
</Viewbox> |
<Ellipse Width="50" Height="50" Fill="CornflowerBlue" /> |
||||
<Viewbox Grid.Row="2" Grid.Column="2" Stretch="Uniform"> |
</Viewbox> |
||||
<Path Fill="Blue" Data="{StaticResource Acorn}"/> |
</Border> |
||||
</Viewbox> |
</Border> |
||||
<Viewbox Grid.Row="3" Grid.Column="2" Stretch="UniformToFill"> |
|
||||
<Path Fill="Blue" Data="{StaticResource Acorn}"/> |
<StackPanel HorizontalAlignment="Left" Orientation="Vertical" Grid.Column="1" Margin="8,0,0,0" Width="150"> |
||||
</Viewbox> |
<TextBlock Text="Width" /> |
||||
|
<Slider Minimum="10" Maximum="200" Value="100" x:Name="WidthSlider" TickFrequency="25" TickPlacement="TopLeft" /> |
||||
|
<TextBlock Text="Height" /> |
||||
|
<Slider Minimum="10" Maximum="200" Value="100" x:Name="HeightSlider" TickFrequency="25" TickPlacement="TopLeft" /> |
||||
|
<TextBlock Text="Stretch" /> |
||||
|
<ComboBox x:Name="StretchSelector" HorizontalAlignment="Stretch" Margin="0,0,0,2" /> |
||||
|
<TextBlock Text="Stretch Direction" /> |
||||
|
<ComboBox x:Name="StretchDirectionSelector" HorizontalAlignment="Stretch" /> |
||||
|
</StackPanel> |
||||
</Grid> |
</Grid> |
||||
|
|
||||
</Grid> |
</Grid> |
||||
</UserControl> |
</UserControl> |
||||
|
|||||
@ -1,141 +1,232 @@ |
|||||
<Styles xmlns="https://github.com/avaloniaui"> |
<Styles xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
||||
|
<Design.PreviewWith> |
||||
|
<Border Padding="20"> |
||||
|
<StackPanel Orientation="Vertical" Spacing="20"> |
||||
|
<Expander ExpandDirection="Up" Header="Expand Up"> |
||||
|
<StackPanel> |
||||
|
<TextBlock>Expanded content</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Expander> |
||||
|
<Expander ExpandDirection="Down" Header="Expand Down"> |
||||
|
<StackPanel> |
||||
|
<TextBlock>Expanded content</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Expander> |
||||
|
<Expander ExpandDirection="Left" Header="Expand Left"> |
||||
|
<StackPanel> |
||||
|
<TextBlock>Expanded content</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Expander> |
||||
|
<Expander ExpandDirection="Right" Header="Expand Right"> |
||||
|
<StackPanel> |
||||
|
<TextBlock>Expanded content</TextBlock> |
||||
|
</StackPanel> |
||||
|
</Expander> |
||||
|
</StackPanel> |
||||
|
</Border> |
||||
|
</Design.PreviewWith> |
||||
|
|
||||
|
<Styles.Resources> |
||||
|
<Thickness x:Key="ExpanderHeaderPadding">16</Thickness> |
||||
|
<Thickness x:Key="ExpanderContentPadding">16</Thickness> |
||||
|
|
||||
|
<Thickness x:Key="ExpanderBorderThickness">1</Thickness> |
||||
|
|
||||
|
<Thickness x:Key="ExpanderDropdownLeftBorderThickness">1,1,0,1</Thickness> |
||||
|
<Thickness x:Key="ExpanderDropdownUpBorderThickness">1,1,1,0</Thickness> |
||||
|
<Thickness x:Key="ExpanderDropdownRightBorderThickness">0,1,1,1</Thickness> |
||||
|
<Thickness x:Key="ExpanderDropdownDownBorderThickness">1,0,1,1</Thickness> |
||||
|
|
||||
|
<SolidColorBrush x:Key="ExpanderBackground" Color="{DynamicResource SystemAltMediumHighColor}" /> |
||||
|
<SolidColorBrush x:Key="ExpanderBorderBrush" Color="{DynamicResource SystemBaseLowColor}" /> |
||||
|
|
||||
|
<SolidColorBrush x:Key="ExpanderDropDownBackground" Color="{DynamicResource SystemChromeMediumLowColor}" /> |
||||
|
<SolidColorBrush x:Key="ExpanderDropDownBorderBrush" Color="{DynamicResource SystemBaseLowColor}" /> |
||||
|
|
||||
|
<SolidColorBrush x:Key="ExpanderForeground" Color="{DynamicResource SystemBaseHighColor}" /> |
||||
|
|
||||
|
<SolidColorBrush x:Key="ExpanderChevronForeground" Color="{DynamicResource SystemBaseHighColor}" /> |
||||
|
</Styles.Resources> |
||||
<Style Selector="Expander"> |
<Style Selector="Expander"> |
||||
<Setter Property="ContentTransition"> |
<Setter Property="Background" Value="{DynamicResource ExpanderBackground}" /> |
||||
<Setter.Value> |
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderBorderThickness}" /> |
||||
<CrossFade Duration="00:00:00.25" /> |
<Setter Property="BorderBrush" Value="{DynamicResource ExpanderBorderBrush}" /> |
||||
</Setter.Value> |
<Setter Property="Padding" Value="{DynamicResource ExpanderHeaderPadding}" /> |
||||
</Setter> |
<Setter Property="HorizontalAlignment" Value="Stretch" /> |
||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
||||
|
<Setter Property="VerticalContentAlignment" Value="Center" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="Expander[ExpandDirection=Down]"> |
<Style Selector="Expander"> |
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<Border Background="{TemplateBinding Background}"> |
|
||||
<Grid RowDefinitions="Auto,*"> |
|
||||
<ToggleButton Name="PART_toggle" Grid.Row="0" Content="{TemplateBinding Header}" IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
|
||||
<ContentPresenter Name="PART_ContentPresenter" |
|
||||
Grid.Row="1" |
|
||||
IsVisible="{TemplateBinding IsExpanded}" |
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
||||
Content="{TemplateBinding Content}" |
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
||||
Padding="{TemplateBinding Padding}" /> |
|
||||
</Grid> |
|
||||
</Border> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
<Style Selector="Expander[IsExpanded=true] /template/ ToggleButton#PART_toggle /template/ ContentPresenter#PART_ContentPresenter"> |
|
||||
<Setter Property="TextBlock.Foreground" Value="{DynamicResource ToggleButtonForeground}"/> |
|
||||
</Style> |
|
||||
<Style Selector="Expander[ExpandDirection=Up]"> |
|
||||
<Setter Property="Template"> |
<Setter Property="Template"> |
||||
<ControlTemplate> |
<ControlTemplate> |
||||
<Border Background="{TemplateBinding Background}"> |
<DockPanel> |
||||
<Grid RowDefinitions="*,Auto"> |
<ToggleButton x:Name="ExpanderHeader" |
||||
<ToggleButton Name="PART_toggle" Grid.Row="1" Content="{TemplateBinding Header}" IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
Padding="{TemplateBinding Padding}" |
||||
<ContentPresenter Name="PART_ContentPresenter" |
HorizontalAlignment="{TemplateBinding HorizontalAlignment}" |
||||
Grid.Row="0" |
Background="{TemplateBinding Background}" |
||||
IsVisible="{TemplateBinding IsExpanded}" |
BorderBrush="{TemplateBinding BorderBrush}" |
||||
ContentTemplate="{TemplateBinding ContentTemplate}" |
BorderThickness="{TemplateBinding BorderThickness}" |
||||
Content="{TemplateBinding Content}" |
Content="{TemplateBinding Header}" |
||||
|
ContentTemplate="{TemplateBinding HeaderTemplate}" |
||||
|
IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" |
||||
|
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}}"> |
||||
|
<ContentPresenter x:Name="PART_ContentPresenter" |
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
||||
Padding="{TemplateBinding Padding}" /> |
|
||||
</Grid> |
|
||||
</Border> |
|
||||
</ControlTemplate> |
|
||||
</Setter> |
|
||||
</Style> |
|
||||
<Style Selector="Expander[ExpandDirection=Right]"> |
|
||||
<Setter Property="Template"> |
|
||||
<ControlTemplate> |
|
||||
<Border Background="{TemplateBinding Background}"> |
|
||||
<Grid ColumnDefinitions="Auto,*"> |
|
||||
<ToggleButton Name="PART_toggle" Grid.Column="0" Content="{TemplateBinding Header}" IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
|
||||
<ContentPresenter Name="PART_ContentPresenter" |
|
||||
Grid.Column="1" |
|
||||
IsVisible="{TemplateBinding IsExpanded}" |
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
||||
Content="{TemplateBinding Content}" |
Content="{TemplateBinding Content}" |
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
ContentTemplate="{TemplateBinding ContentTemplate}" /> |
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
</Border> |
||||
Padding="{TemplateBinding Padding}" /> |
</DockPanel> |
||||
</Grid> |
|
||||
</Border> |
|
||||
</ControlTemplate> |
</ControlTemplate> |
||||
</Setter> |
</Setter> |
||||
</Style> |
</Style> |
||||
<Style Selector="Expander[ExpandDirection=Left]"> |
|
||||
|
<Style Selector="Expander /template/ ToggleButton#ExpanderHeader"> |
||||
|
<Setter Property="HorizontalContentAlignment" Value="Left" /> |
||||
<Setter Property="Template"> |
<Setter Property="Template"> |
||||
<ControlTemplate> |
<ControlTemplate> |
||||
<Border Background="{TemplateBinding Background}"> |
<Border x:Name="ToggleButtonBackground"> |
||||
<Grid ColumnDefinitions="*,Auto"> |
<Grid ColumnDefinitions="*,Auto"> |
||||
<ToggleButton Name="PART_toggle" Grid.Column="1" Content="{TemplateBinding Header}" IsChecked="{TemplateBinding IsExpanded, Mode=TwoWay}" /> |
<ContentPresenter x:Name="PART_ContentPresenter" |
||||
<ContentPresenter Name="PART_ContentPresenter" |
Margin="{TemplateBinding Padding}" |
||||
Grid.Column="0" |
|
||||
IsVisible="{TemplateBinding IsExpanded}" |
|
||||
ContentTemplate="{TemplateBinding ContentTemplate}" |
|
||||
Content="{TemplateBinding Content}" |
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
VerticalContentAlignment="Center" |
||||
Padding="{TemplateBinding Padding}" /> |
Background="Transparent" |
||||
</Grid> |
BorderBrush="Transparent" |
||||
</Border> |
BorderThickness="0" |
||||
</ControlTemplate> |
Content="{TemplateBinding Content}" |
||||
</Setter> |
ContentTemplate="{TemplateBinding ContentTemplate}" |
||||
</Style> |
TextBlock.Foreground="{DynamicResource ExpanderForeground}" /> |
||||
<Style Selector="Expander /template/ ToggleButton#PART_toggle"> |
<Border x:Name="ExpandCollapseChevronBorder" |
||||
<Setter Property="Template"> |
Grid.Column="1" |
||||
<ControlTemplate> |
Width="32" |
||||
<Border BorderThickness="1" Background="Transparent"> |
Height="32" |
||||
<Grid ColumnDefinitions="Auto,Auto"> |
Margin="7" |
||||
<Border Grid.Column="0" Width="20" Height="20" HorizontalAlignment="Center" VerticalAlignment="Center"> |
RenderTransformOrigin="50%,50%"> |
||||
<Path Fill="{DynamicResource SystemControlForegroundBaseHighBrush}" |
<Path x:Name="ExpandCollapseChevron" |
||||
HorizontalAlignment="Center" |
HorizontalAlignment="Center" |
||||
VerticalAlignment="Center" |
VerticalAlignment="Center" |
||||
Data="M 0 2 L 4 6 L 0 10 Z" /> |
RenderTransformOrigin="50%,50%" |
||||
|
Stretch="None" |
||||
|
Stroke="{DynamicResource ExpanderChevronForeground}" |
||||
|
StrokeThickness="1" /> |
||||
|
<Border.RenderTransform> |
||||
|
<RotateTransform /> |
||||
|
</Border.RenderTransform> |
||||
</Border> |
</Border> |
||||
<ContentPresenter Name="PART_ContentPresenter" |
|
||||
Grid.Column="1" |
|
||||
Background="Transparent" |
|
||||
Content="{TemplateBinding Content}" |
|
||||
VerticalAlignment="Center" |
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" |
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" |
|
||||
Padding="{TemplateBinding Padding}"/> |
|
||||
</Grid> |
</Grid> |
||||
</Border> |
</Border> |
||||
</ControlTemplate> |
</ControlTemplate> |
||||
</Setter> |
</Setter> |
||||
</Style> |
</Style> |
||||
<Style Selector="Expander /template/ ToggleButton#PART_toggle:pointerover /template/ Border"> |
<Style Selector="Expander /template/ ToggleButton#ExpanderHeader:pressed"> |
||||
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlHighlightBaseMediumBrush}" /> |
<Setter Property="RenderTransform" Value="{x:Null}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="Expander:down:expanded /template/ ToggleButton#PART_toggle /template/ Path"> |
|
||||
<Setter Property="RenderTransform"> |
<Style Selector="Expander:left /template/ ToggleButton#ExpanderHeader, Expander:right /template/ ToggleButton#ExpanderHeader"> |
||||
<RotateTransform Angle="90" /> |
<Setter Property="VerticalAlignment" Value="Stretch" /> |
||||
</Setter> |
|
||||
</Style> |
</Style> |
||||
<Style Selector="Expander:up:expanded /template/ ToggleButton#PART_toggle /template/ Path"> |
|
||||
<Setter Property="RenderTransform"> |
|
||||
<RotateTransform Angle="-90" /> |
<Style Selector="Expander /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
</Setter> |
<Setter Property="Background" Value="{TemplateBinding Background}" /> |
||||
|
<Setter Property="BorderBrush" Value="{TemplateBinding BorderBrush}" /> |
||||
|
<Setter Property="BorderThickness" Value="{TemplateBinding BorderThickness}" /> |
||||
</Style> |
</Style> |
||||
<Style Selector="Expander:left:expanded /template/ ToggleButton#PART_toggle /template/ Path"> |
|
||||
<Setter Property="RenderTransform"> |
<Style Selector="Expander:not(:expanded) /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
<RotateTransform Angle="180" /> |
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" /> |
||||
</Setter> |
|
||||
</Style> |
</Style> |
||||
<Style Selector="Expander:right /template/ ToggleButton#PART_toggle /template/ Path"> |
<Style Selector="Expander:expanded:up /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
<Setter Property="RenderTransform"> |
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" /> |
||||
<RotateTransform Angle="180" /> |
|
||||
</Setter> |
|
||||
</Style> |
</Style> |
||||
<Style Selector="Expander:right:expanded /template/ ToggleButton#PART_toggle /template/ Path"> |
<Style Selector="Expander:expanded:up /template/ Border#ExpanderContent"> |
||||
<Setter Property="RenderTransform"> |
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}" /> |
||||
<RotateTransform Angle="0" /> |
</Style> |
||||
</Setter> |
<Style Selector="Expander:expanded:down /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource TopCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:expanded:down /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource BottomCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:expanded:left /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource RightCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:expanded:left /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource LeftCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:expanded:right /template/ ToggleButton#ExpanderHeader /template/ Border#ToggleButtonBackground"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource LeftCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:expanded:right /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="CornerRadius" Value="{Binding Source={StaticResource ControlCornerRadius}, Converter={StaticResource RightCornerRadiusFilterConverter}}" /> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="Expander:left /template/ ToggleButton#ExpanderHeader"> |
||||
|
<Setter Property="DockPanel.Dock" Value="Right" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:up /template/ ToggleButton#ExpanderHeader"> |
||||
|
<Setter Property="DockPanel.Dock" Value="Bottom" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:right /template/ ToggleButton#ExpanderHeader"> |
||||
|
<Setter Property="DockPanel.Dock" Value="Left" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:down /template/ ToggleButton#ExpanderHeader"> |
||||
|
<Setter Property="DockPanel.Dock" Value="Top" /> |
||||
|
</Style> |
||||
|
|
||||
|
|
||||
|
<Style Selector="Expander:expanded /template/ ToggleButton#ExpanderHeader /template/ Border#ExpandCollapseChevronBorder"> |
||||
|
<Style.Animations> |
||||
|
<Animation FillMode="Both" Duration="0:0:0.0625"> |
||||
|
<KeyFrame Cue="100%"> |
||||
|
<Setter Property="RotateTransform.Angle" Value="180" /> |
||||
|
</KeyFrame> |
||||
|
</Animation> |
||||
|
</Style.Animations> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:not(:expanded) /template/ ToggleButton#ExpanderHeader /template/ Border#ExpandCollapseChevronBorder"> |
||||
|
<Style.Animations> |
||||
|
<Animation FillMode="Both" Duration="0:0:0.0625"> |
||||
|
<KeyFrame Cue="0%"> |
||||
|
<Setter Property="RotateTransform.Angle" Value="180" /> |
||||
|
</KeyFrame> |
||||
|
<KeyFrame Cue="100%"> |
||||
|
<Setter Property="RotateTransform.Angle" Value="0" /> |
||||
|
</KeyFrame> |
||||
|
</Animation> |
||||
|
</Style.Animations> |
||||
|
</Style> |
||||
|
|
||||
|
<Style Selector="Expander:left /template/ ToggleButton#ExpanderHeader /template/ Path#ExpandCollapseChevron"> |
||||
|
<Setter Property="Data" Value="M 7 0 L 0 7 L 7 14" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:up /template/ ToggleButton#ExpanderHeader /template/ Path#ExpandCollapseChevron"> |
||||
|
<Setter Property="Data" Value="M 0 7 L 7 0 L 14 7" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:right /template/ ToggleButton#ExpanderHeader /template/ Path#ExpandCollapseChevron"> |
||||
|
<Setter Property="Data" Value="M 0 0 L 7 7 L 0 14" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:down /template/ ToggleButton#ExpanderHeader /template/ Path#ExpandCollapseChevron"> |
||||
|
<Setter Property="Data" Value="M 0 0 L 7 7 L 14 0" /> |
||||
|
</Style> |
||||
|
|
||||
|
|
||||
|
<Style Selector="Expander:left /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderDropdownLeftBorderThickness}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:up /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderDropdownUpBorderThickness}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:right /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderDropdownRightBorderThickness}" /> |
||||
|
</Style> |
||||
|
<Style Selector="Expander:down /template/ Border#ExpanderContent"> |
||||
|
<Setter Property="BorderThickness" Value="{DynamicResource ExpanderDropdownDownBorderThickness}" /> |
||||
</Style> |
</Style> |
||||
</Styles> |
</Styles> |
||||
|
|||||
@ -0,0 +1,23 @@ |
|||||
|
using System; |
||||
|
using System.Reactive.Linq; |
||||
|
|
||||
|
using Avalonia.Animation.Animators; |
||||
|
using Avalonia.Media; |
||||
|
|
||||
|
namespace Avalonia.Animation |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// Transition class that handles <see cref="AvaloniaProperty"/> with <see cref="BoxShadows"/> type.
|
||||
|
/// </summary>
|
||||
|
public class BoxShadowsTransition : Transition<BoxShadows> |
||||
|
{ |
||||
|
private static readonly BoxShadowsAnimator s_animator = new BoxShadowsAnimator(); |
||||
|
|
||||
|
/// <inheritdocs/>
|
||||
|
public override IObservable<BoxShadows> DoTransition(IObservable<double> progress, BoxShadows oldValue, BoxShadows newValue) |
||||
|
{ |
||||
|
return progress |
||||
|
.Select(progress => s_animator.Interpolate(Easing.Ease(progress), oldValue, newValue)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue