This commit is contained in:
ShrlAlgo
2025-07-11 09:20:23 +08:00
parent c7b104f44f
commit 4d35cadb56
840 changed files with 102347 additions and 11595 deletions

View File

@@ -19,63 +19,159 @@
Header="WPF UI anchor.">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:Anchor
IsEnabled="{Binding ElementName=CBDisableAnchor,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}"
Grid.Column="0"
Content="Anchor"
Icon="{ui:SymbolIcon Link24}"
IsEnabled="{Binding ElementName=CBDisableAnchor,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}"
NavigateUri="https://www.shrlalgo.com/" />
<CheckBox
<ui:Badge
Grid.Column="1"
Appearance="Caution"
Content="Badge" />
<CheckBox
x:Name="CBDisableAnchor"
Grid.Column="2"
HorizontalAlignment="Right"
Content="禁用anchor" />
</Grid>
</GroupBox>
<GroupBox Header="Badge">
<ui:Badge Appearance="Caution" Content="徽章" />
</GroupBox>
<GroupBox Header="IconButton">
<GroupBox Header="Button">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<Button Click="Button_Click" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
<ui:SymbolIcon Symbol="Button20" />
</Button>
<Button
Command="{Binding ButtonClickCommand}"
Content="消息"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<Button
Grid.Column="0"
Content="默认按钮"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Grid.Column="0"
Content="UiButton"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
HorizontalAlignment="Center"
Appearance="Primary"
Content="AccentUiButton"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Appearance="Secondary"
Content="FontIcon button"
Icon="{ui:FontIcon 🌈}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Appearance="Danger"
Content="ImageIconButton"
Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:StackPanel Spacing="5">
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock
Width="120"
VerticalAlignment="Center"
Text="Button:"
TextAlignment="Right" />
<Button
Width="120"
Content="Default"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<RepeatButton Width="120" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
<StackPanel Orientation="Horizontal">
<ui:SymbolIcon Symbol="KeyCommand16" />
<TextBlock Text="Repeat" />
</StackPanel>
</RepeatButton>
<Button Width="120" IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}">
<StackPanel Orientation="Horizontal">
<ui:SymbolIcon Symbol="KeyCommand16" />
<TextBlock Text="Icon" />
</StackPanel>
</Button>
</ui:StackPanel>
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock
Width="120"
VerticalAlignment="Center"
Text="UiButton:"
TextAlignment="Right" />
<ui:Button
Width="120"
Appearance="Primary"
Content="Primary"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Appearance="Accent"
Content="Accent"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</ui:StackPanel>
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock
Width="120"
VerticalAlignment="Center"
Text="AccentUiButton:" />
<ui:Button
Width="120"
Appearance="Attention"
Command="{Binding ButtonClickCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
Content="Attention"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Appearance="Success"
Command="{Binding ButtonClickCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
Content="Success"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Appearance="Caution"
Command="{Binding ButtonClickCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
Content="Caution"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Appearance="Critical"
Command="{Binding ButtonClickCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
Content="Critical"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</ui:StackPanel>
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock
Width="120"
VerticalAlignment="Center"
Text="IconUiButton:"
TextAlignment="Right" />
<ui:Button
Width="120"
Content="Symbol"
Icon="{ui:SymbolIcon Fluent24}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Content="Font"
Icon="{ui:FontIcon 🌈}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Content="Image"
Icon="{ui:ImageIcon pack://application:\,\,\,/WPFluent.Gallery;component/wpfui.png}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</ui:StackPanel>
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<TextBlock
Width="120"
VerticalAlignment="Center"
Text="MessageBox:"
TextAlignment="Right" />
<ui:Button
Width="120"
Content="Sync"
Icon="{ui:SymbolIcon Symbol=Info16}"
Command="{Binding MsgSyncCommand}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Content="Async"
Command="{Binding MsgAsyncCommand}"
Icon="{ui:SymbolIcon Symbol=Info16}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<ui:Button
Width="120"
Content="Pending"
Command="{Binding MsgPendingCommand}"
Icon="{ui:SymbolIcon Symbol=Info16}"
IsEnabled="{Binding ElementName=CBDisableButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</ui:StackPanel>
</ui:StackPanel>
<CheckBox
x:Name="CBDisableButton"
@@ -98,6 +194,7 @@
OnContent="开" />
<ToggleButton
Grid.Column="0"
Width="120"
Content="切换按钮"
IsEnabled="{Binding ElementName=CBDisableToggle,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</ui:StackPanel>
@@ -122,7 +219,7 @@
<ComboBox
MinWidth="150"
HorizontalAlignment="Left"
ItemsSource="{Binding ViewModel.ComboBoxFontFamilies, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}"
ItemsSource="{Binding ComboBoxFontFamilies, Mode=OneWay}"
SelectedIndex="0">
<ComboBox.ItemTemplate>
<DataTemplate>
@@ -141,7 +238,7 @@
HorizontalAlignment="Left"
Header="带标题:"
HeaderPlacement="Left"
ItemsSource="{Binding ViewModel.ComboBoxFontFamilies, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}" />
ItemsSource="{Binding ComboBoxFontFamilies, Mode=OneWay}" />
</ui:StackPanel>
</GroupBox>
<GroupBox Margin="0" Header="A DropDownButton">
@@ -198,28 +295,42 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<ui:StackPanel Grid.Column="0" Orientation="Horizontal" Spacing="30">
<StackPanel Orientation="Horizontal">
<RadioButton
Content="选项 1"
GroupName="radio_group_one"
IsChecked="True"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<RadioButton
Content="选项 1"
GroupName="radio_group_one"
IsChecked="True"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
Content="选项 2"
GroupName="radio_group_one"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<RadioButton
Content="选项 1"
FlowDirection="RightToLeft"
GroupName="radio_group_two"
IsChecked="True"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<RadioButton
Content="选项 2"
GroupName="radio_group_one"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<RadioButton
Content="选项 1"
FlowDirection="RightToLeft"
GroupName="radio_group_two"
IsChecked="True"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
<RadioButton
Content="选项 2"
FlowDirection="RightToLeft"
GroupName="radio_group_two"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</StackPanel>
Content="选项 2"
FlowDirection="RightToLeft"
GroupName="radio_group_two"
IsEnabled="{Binding ElementName=CBDisableRadioButton,Path=IsChecked,Converter={StaticResource InvertBooleanConverter}}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<StackPanel.Resources>
<ui:ToggleButtonGroup x:Key="ToggleButtonGroup" />
</StackPanel.Resources>
<ToggleButton
Content="1st"
IsChecked="True"
ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
<ToggleButton Content="2nd" ui:ToggleButtonGroup.Group="{DynamicResource ToggleButtonGroup}" />
</StackPanel>
</ui:StackPanel>
<CheckBox
x:Name="CBDisableRadioButton"
Grid.Column="1"
@@ -247,7 +358,10 @@
<Label Margin="0,0,0,-4" Content="值:" />
<TextBlock Margin="0" Text="{Binding ElementName=UiRating,Path=Value}" />
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel
Grid.Column="2"
HorizontalAlignment="Right"
Orientation="Horizontal">
<CheckBox
x:Name="CBSetFull"
VerticalAlignment="Center"
@@ -268,21 +382,21 @@
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal">
<Slider
x:Name="Slider"
Width="200"
Margin="10,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Value="{Binding ViewModel.RangeSliderValue, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}"
IsSnapToTickEnabled="{Binding ElementName=CBSnapToTick,Path=IsChecked}"
Maximum="100"
Minimum="0"
TickFrequency="20"
TickPlacement="{Binding ElementName=CBPlacement,Path=SelectedItem}" />
<TextBlock VerticalAlignment="Center" Text="值:" />
<TextBlock VerticalAlignment="Center" Text="{Binding ViewModel.RangeSliderValue, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type pages:BasicInputPage}, Mode=FindAncestor}}" />
<TextBlock VerticalAlignment="Center" Text="{Binding ElementName=Slider,Path=Value, Mode=OneWay}" />
</StackPanel>
<Grid Grid.Column="1">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<ComboBox
x:Name="CBPlacement"
Margin="10,0"
@@ -415,6 +529,42 @@
<ui:ColorPickerControl VerticalAlignment="Top" />
</StackPanel>
</GroupBox>
<GroupBox Header="Flyout">
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<ui:Flyout IsOpen="{Binding IsFlyoutOpen, Mode=TwoWay}" Placement="Top">
<StackPanel>
<TextBlock
Width="280"
HorizontalAlignment="Left"
Text="Replicants like any other machine are either a benefit or a hazard. If they're a benefit it's not my problem."
TextWrapping="WrapWithOverflow" />
<Button Margin="0,8,0,0" Content="The cake is a lie!" />
</StackPanel>
</ui:Flyout>
<Button
Command="{Binding FlyoutButtonClickCommand, Mode=OneWay}"
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
Content="Open flyout" />
<Button
Command="{Binding OpenCustomMessageBoxCommand}"
CommandParameter="{Binding Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
Content="Open UI MessageBox" />
</ui:StackPanel>
</GroupBox>
<GroupBox Header="Media">
<ui:StackPanel Orientation="Horizontal" Spacing="5">
<Image
Height="200"
HorizontalAlignment="Left"
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
<ui:Image
Height="200"
HorizontalAlignment="Left"
BorderBrush="#33000000"
BorderThickness="2"
CornerRadius="4"
Source="pack://application:,,,/WPFluent.Gallery;component/Assets/pexels-johannes-plenio-1103970.jpg" />
</ui:StackPanel>
</GroupBox>
</ui:StackPanel>
</Page>