fix: use DropDownButton instead of DropdownButton.

This commit is contained in:
Zhang Dian 2023-03-25 21:34:55 +08:00
parent 117fce4a61
commit 41e57b5034
7 changed files with 12 additions and 12 deletions

View File

@ -45,7 +45,7 @@
Danger Danger
</Button> </Button>
</StackPanel> </StackPanel>
<TextBlock>DropdownButton</TextBlock> <TextBlock>DropDownButton</TextBlock>
<StackPanel Orientation="Horizontal" Spacing="8"> <StackPanel Orientation="Horizontal" Spacing="8">
<DropDownButton Content="Submit"> <DropDownButton Content="Submit">
<DropDownButton.Flyout> <DropDownButton.Flyout>
@ -55,7 +55,7 @@
</MenuFlyout> </MenuFlyout>
</DropDownButton.Flyout> </DropDownButton.Flyout>
</DropDownButton> </DropDownButton>
<DropDownButton Content="Submit" Theme="{DynamicResource SolidDropdownButton}"> <DropDownButton Content="Submit" Theme="{DynamicResource SolidDropDownButton}">
<DropDownButton.Flyout> <DropDownButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight"> <MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" /> <MenuItem Header="Submit All" />
@ -63,7 +63,7 @@
</MenuFlyout> </MenuFlyout>
</DropDownButton.Flyout> </DropDownButton.Flyout>
</DropDownButton> </DropDownButton>
<DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropdownButton}"> <DropDownButton Content="Submit" Theme="{DynamicResource BorderlessDropDownButton}">
<DropDownButton.Flyout> <DropDownButton.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight"> <MenuFlyout Placement="BottomEdgeAlignedRight">
<MenuItem Header="Submit All" /> <MenuItem Header="Submit All" />

View File

@ -18,7 +18,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/ContextMenu.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/DropdownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/DropDownButton.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/EmbeddableControlRoot.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/EmbeddableControlRoot.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/Expander.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Controls/FlyoutPresenter.axaml" />

View File

@ -44,7 +44,7 @@
Margin="0,0,8,0" Margin="0,0,8,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Data="{DynamicResource DropdownButtonIconGlyph}" Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
IsHitTestVisible="False" IsHitTestVisible="False"
UseLayoutRounding="False" /> UseLayoutRounding="False" />
@ -97,7 +97,7 @@
</Style> </Style>
</ControlTheme> </ControlTheme>
<ControlTheme x:Key="SolidDropdownButton" TargetType="DropDownButton"> <ControlTheme x:Key="SolidDropDownButton" TargetType="DropDownButton">
<Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" /> <Setter Property="DropDownButton.Foreground" Value="{DynamicResource ButtonSolidForeground}" />
<Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" /> <Setter Property="DropDownButton.Background" Value="{DynamicResource ButtonSolidPrimaryBackground}" />
<Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" /> <Setter Property="DropDownButton.BorderBrush" Value="{DynamicResource ButtonSolidPrimaryBorderBrush}" />
@ -138,7 +138,7 @@
Margin="0,0,8,0" Margin="0,0,8,0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Data="{DynamicResource DropdownButtonIconGlyph}" Data="{DynamicResource DropDownButtonIconGlyph}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
IsHitTestVisible="False" IsHitTestVisible="False"
UseLayoutRounding="False" /> UseLayoutRounding="False" />
@ -225,7 +225,7 @@
</ControlTheme> </ControlTheme>
<ControlTheme <ControlTheme
x:Key="BorderlessDropdownButton" x:Key="BorderlessDropDownButton"
BasedOn="{StaticResource {x:Type DropDownButton}}" BasedOn="{StaticResource {x:Type DropDownButton}}"
TargetType="DropDownButton"> TargetType="DropDownButton">
<Setter Property="DropDownButton.Background" Value="Transparent" /> <Setter Property="DropDownButton.Background" Value="Transparent" />

View File

@ -15,7 +15,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DropdownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/DropDownButton.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Expander.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Expander.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/GridSplitter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/GridSplitter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Label.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Dark/Label.axaml" />

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here --> <!-- Add Resources Here -->
<PathGeometry x:Key="DropdownButtonIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</PathGeometry> <PathGeometry x:Key="DropDownButtonIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</PathGeometry>
</ResourceDictionary> </ResourceDictionary>

View File

@ -1,4 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here --> <!-- Add Resources Here -->
<PathGeometry x:Key="DropdownButtonIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</PathGeometry> <PathGeometry x:Key="DropDownButtonIconGlyph">M4.08045 7.59809C4.66624 7.01231 5.61599 7.01231 6.20177 7.59809L11.8586 13.2549L17.5155 7.59809C18.1013 7.01231 19.051 7.01231 19.6368 7.59809C20.2226 8.18388 20.2226 9.13363 19.6368 9.71941L12.9193 16.4369C12.3335 17.0227 11.3838 17.0227 10.798 16.4369L4.08045 9.71941C3.49467 9.13363 3.49467 8.18388 4.08045 7.59809Z</PathGeometry>
</ResourceDictionary> </ResourceDictionary>

View File

@ -14,7 +14,7 @@
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ComboBox.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/ComboBox.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DatePicker.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DatePicker.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DateTimePickerShared.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DropdownButton.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/DropDownButton.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Expander.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Expander.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/GridSplitter.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/GridSplitter.axaml" />
<ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Label.axaml" /> <ResourceInclude Source="avares://Semi.Avalonia/Themes/Light/Label.axaml" />