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

@@ -1,209 +1,150 @@
<Page
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Title="StatusAndInfoPage"
d:DataContext="{d:DesignInstance pages:StatusAndInfoPage,
IsDesignTimeCreatable=False}"
mc:Ignorable="d"
x:Class="WPFluent.Gallery.Views.Pages.StatusAndInfoPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:WPFluent.Gallery.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="clr-namespace:WPFluent.Gallery.Models"
xmlns:pages="clr-namespace:WPFluent.Gallery.Views.Pages"
xmlns:ui="https://github.com/ShrlAlgo/WPFluent"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
mc:Ignorable="d"
d:DataContext="{d:DesignInstance pages:StatusAndInfoPage,
IsDesignTimeCreatable=False}"
Foreground="{DynamicResource TextFillColorPrimaryBrush}"
Title="StatusAndInfoPage">
<ui:StackPanel Spacing="5">
<GroupBox
Header="WPF UI NavigationView."
Padding="0">
</GroupBox>
<GroupBox Header="Different InfoBadge Styles" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<ui:InfoBadge
CornerRadius="30"
Icon="{ui:SymbolIcon Alert16}"
Margin="10"
Severity="{Binding ViewModel.InfoBadgeSeverity}"
Style="{DynamicResource IconInfoBadgeStyle}" />
<ui:InfoBadge
Margin="10"
Severity="{Binding ViewModel.InfoBadgeSeverity}"
Style="{DynamicResource ValueInfoBadgeStyle}"
Value="1" />
<ui:InfoBadge
Margin="10"
Severity="{Binding ViewModel.InfoBadgeSeverity}"
Style="{DynamicResource DotInfoBadgeStyle}"
Value="2" />
</WrapPanel>
<StackPanel Grid.Column="1" Margin="12,0,0,0">
<ui:TextBlock Text="InfoBadge Severity" />
<ComboBox
Margin="0,8,0,0"
MinWidth="140"
SelectedIndex="{Binding ViewModel.InfoBadgeSeverityComboBoxSelectedIndex, Mode=TwoWay}">
<ComboBoxItem Content="Attention" />
<ComboBoxItem Content="Informational" />
<ComboBoxItem Content="Success" />
<ComboBoxItem Content="Caution" />
<ComboBoxItem Content="Critical" />
</ComboBox>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="InfoBadge with Dynamic Value" >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:InfoBadge
Padding="6,0"
Severity="{Binding ViewModel.InfoBadgeSeverity}"
Value="{Binding Value, ElementName=ValueNumberBox}" />
<StackPanel Grid.Column="1" Margin="12,0,0,0">
<ui:TextBlock Text="InfoBadge Value" />
<ui:NumberBox
Maximum="100"
Minimum="0"
Value="1"
x:Name="ValueNumberBox" />
<ui:TextBlock Text="InfoBadge Severity" />
<ComboBox
Margin="0,8,0,0"
MinWidth="140"
SelectedIndex="{Binding ViewModel.InfoBadgeSeverityComboBoxSelectedIndex, Mode=TwoWay}">
<ComboBoxItem Content="Attention" />
<ComboBoxItem Content="Informational" />
<ComboBoxItem Content="Success" />
<ComboBoxItem Content="Caution" />
<ComboBoxItem Content="Critical" />
</ComboBox>
</StackPanel>
</Grid>
</GroupBox>
<GroupBox Header="Placing an InfoBadge Inside Another">
<Grid>
<GroupBox Header="InfoBadge">
<UniformGrid Rows="1">
<ui:Button
Height="60"
HorizontalAlignment="Center"
HorizontalContentAlignment="Stretch"
Padding="0"
ToolTip="Refresh required"
VerticalAlignment="Center"
Width="200">
Width="200"
Height="60"
HorizontalAlignment="Center"
VerticalAlignment="Center"
HorizontalContentAlignment="Stretch"
Padding="0"
ToolTip="Refresh required">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ui:InfoBadge
HorizontalAlignment="Right"
Margin="0,-10,5,0"
Severity="Critical"
Style="{DynamicResource DotInfoBadgeStyle}"
Value="{Binding Value, ElementName=ValueNumberBox}"
VerticalAlignment="Top" />
Margin="0,-10,5,0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Width="10"
Height="10"
Value="{Binding Value, ElementName=ValueNumberBox}"
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
Style="{StaticResource DotInfoBadgeStyle}" />
<ui:SymbolIcon
Grid.Column="0"
HorizontalAlignment="Center"
Symbol="ArrowSync24" />
Grid.Column="0"
HorizontalAlignment="Center"
Symbol="ArrowSync24" />
</Grid>
</ui:Button>
</Grid>
</GroupBox>
<GroupBox Header="A closable InfoBar." >
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:InfoBar
Grid.Column="0"
IsOpen="{Binding ViewModel.IsShortInfoBarOpened, Mode=TwoWay}"
Message="Essential app message."
Severity="{Binding ViewModel.ShortInfoBarSeverity, Mode=OneWay}"
Title="Title" />
<Grid Grid.Column="1" Margin="12,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox
Content="Is open"
Grid.Row="0"
IsChecked="{Binding ViewModel.IsShortInfoBarOpened, Mode=TwoWay}"
MinWidth="0" />
<ComboBox
Grid.Row="1"
Margin="0,8,0,0"
MinWidth="140"
SelectedIndex="{Binding ViewModel.ShortInfoBarSeverityComboBoxSelectedIndex, Mode=TwoWay}">
<ComboBoxItem Content="Informational" />
<ComboBoxItem Content="Success" />
<ComboBoxItem Content="Warning" />
<ComboBoxItem Content="Error" />
</ComboBox>
</Grid>
</Grid>
</GroupBox>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<ui:InfoBadge
Margin="10"
CornerRadius="30"
Icon="{ui:SymbolIcon Alert16}"
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
Style="{StaticResource IconInfoBadgeStyle}" />
<GroupBox Header="A closable InfoBar with a long message." >
<ui:InfoBadge
Value="{Binding Value, ElementName=ValueNumberBox}"
Padding="6,0"
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}" />
<ui:InfoBadge
Margin="10"
Value="2"
Severity="{Binding SelectedItem, ElementName=CBInfoBadgeSeverity}"
Style="{StaticResource DotInfoBadgeStyle}" />
</WrapPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" Margin="12,0,0,0">
<ui:TextBlock Text="InfoBadge Value" />
<ui:NumberBox
x:Name="ValueNumberBox"
Value="1"
Maximum="100"
Minimum="0" />
<ui:TextBlock Text="InfoBadge Severity" />
<ComboBox
x:Name="CBInfoBadgeSeverity"
MinWidth="140"
Margin="0,8,0,0"
SelectedIndex="0">
<ComboBox.ItemsSource>
<x:Array Type="{x:Type ui:InfoBadgeSeverity}">
<ui:InfoBadgeSeverity>Attention</ui:InfoBadgeSeverity>
<ui:InfoBadgeSeverity>Success</ui:InfoBadgeSeverity>
<ui:InfoBadgeSeverity>Caution</ui:InfoBadgeSeverity>
<ui:InfoBadgeSeverity>Critical</ui:InfoBadgeSeverity>
</x:Array>
</ComboBox.ItemsSource>
</ComboBox>
</StackPanel>
</Grid>
</UniformGrid>
</GroupBox>
<GroupBox Header="InfoBar">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<ui:InfoBar
Grid.Column="0"
IsOpen="{Binding ViewModel.IsLongInfoBarOpened, Mode=TwoWay}"
Message="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
Severity="{Binding ViewModel.LongInfoBarSeverity, Mode=OneWay}"
Title="Title" />
Grid.Column="0"
IsOpen="{Binding ElementName=CBOpen,Path=IsChecked, Mode=TwoWay}"
Message="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
Severity="{Binding ElementName=CBInfoBarSeverity,Path=SelectedItem, Mode=OneWay}"
Title="Title" />
<Grid Grid.Column="1" Margin="12,0,0,0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<CheckBox
Content="Is open"
Grid.Row="0"
IsChecked="{Binding ViewModel.IsLongInfoBarOpened, Mode=TwoWay}"
MinWidth="0" />
x:Name="CBOpen"
Grid.Row="0"
MinWidth="0"
Content="Is open"
IsChecked="True" />
<ComboBox
Grid.Row="1"
Margin="0,8,0,0"
MinWidth="140"
SelectedIndex="{Binding ViewModel.LongInfoBarSeverityComboBoxSelectedIndex, Mode=TwoWay}">
<ComboBoxItem Content="Informational" />
<ComboBoxItem Content="Success" />
<ComboBoxItem Content="Warning" />
<ComboBoxItem Content="Error" />
x:Name="CBInfoBarSeverity"
Grid.Row="1"
MinWidth="140"
Margin="0,8,0,0"
SelectedIndex="0">
<ComboBox.ItemsSource>
<x:Array Type="{x:Type ui:InfoBarSeverity}">
<ui:InfoBarSeverity>Attention</ui:InfoBarSeverity>
<ui:InfoBarSeverity>Success</ui:InfoBarSeverity>
<ui:InfoBarSeverity>Caution</ui:InfoBarSeverity>
<ui:InfoBarSeverity>Critical</ui:InfoBarSeverity>
</x:Array>
</ComboBox.ItemsSource>
</ComboBox>
</Grid>
</Grid>
</GroupBox>
<GroupBox Header="An indeterminate progress bar." >
<ProgressBar IsIndeterminate="True" Margin="24" />
<GroupBox Header="Progress">
<StackPanel Orientation="Horizontal">
<ProgressBar Margin="24" IsIndeterminate="True" />
<ui:ProgressRing IsIndeterminate="True" />
</StackPanel>
</GroupBox>
<GroupBox Header="An indeterminate WPF UI progress ring." >
<ui:ProgressRing IsIndeterminate="True" />
</GroupBox>
<GroupBox Header="A button with a simple ToolTip." >
<GroupBox Header="ToolTip">
<Button
Content="Button with a simple ToolTip."
ToolTipService.InitialShowDelay="100"
ToolTipService.Placement="MousePoint"
ToolTipService.ToolTip="Simple ToolTip" />
Content="带提示的按钮"
ToolTipService.InitialShowDelay="100"
ToolTipService.Placement="MousePoint"
ToolTipService.ToolTip="简单提示" />
</GroupBox>
<!--<controls:GalleryNavigationPresenter
Grid.Row="1"