feat: enhance NotificationDemo.
This commit is contained in:
parent
a328e2bb99
commit
6630d04565
@ -8,22 +8,25 @@
|
|||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<StackPanel Spacing="20">
|
<StackPanel Spacing="20">
|
||||||
|
<UniformGrid Rows="3" Columns="3" Width="500" HorizontalAlignment="Left">
|
||||||
|
<UniformGrid.Styles>
|
||||||
|
<Style Selector="RadioButton">
|
||||||
|
<Setter Property="Theme" Value="{DynamicResource PureCardRadioButton}" />
|
||||||
|
</Style>
|
||||||
|
</UniformGrid.Styles>
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="TopLeft" />
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="TopCenter" />
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="TopRight" IsChecked="True" />
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="BottomLeft" />
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="BottomCenter" />
|
||||||
|
<RadioButton Click="PositionButton_OnClick" Content="BottomRight" />
|
||||||
|
</UniformGrid>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||||
<Button Click="NormalButton_OnClick" Content="Information" />
|
<Button Click="NormalButton_OnClick" Content="Information" />
|
||||||
<Button Click="NormalButton_OnClick" Content="Success" Classes="Success" />
|
<Button Click="NormalButton_OnClick" Content="Success" Classes="Success" />
|
||||||
<Button Click="NormalButton_OnClick" Content="Warning" Classes="Warning" />
|
<Button Click="NormalButton_OnClick" Content="Warning" Classes="Warning" />
|
||||||
<Button Click="NormalButton_OnClick" Content="Error" Classes="Danger" />
|
<Button Click="NormalButton_OnClick" Content="Error" Classes="Danger" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Button Click="PositionButton_OnClick" Content="TopLeft" />
|
|
||||||
<Button Click="PositionButton_OnClick" Content="TopCenter" />
|
|
||||||
<Button Click="PositionButton_OnClick" Content="TopRight" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<Button Click="PositionButton_OnClick" Content="BottomLeft" />
|
|
||||||
<Button Click="PositionButton_OnClick" Content="BottomCenter" />
|
|
||||||
<Button Click="PositionButton_OnClick" Content="BottomRight" />
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||||
<StackPanel.Styles>
|
<StackPanel.Styles>
|
||||||
<Style Selector="Button">
|
<Style Selector="Button">
|
||||||
|
@ -22,6 +22,15 @@ public partial class NotificationDemo : UserControl
|
|||||||
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
_manager = new WindowNotificationManager(topLevel) { MaxItems = 3 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is RadioButton b && b.Content is string s)
|
||||||
|
{
|
||||||
|
Enum.TryParse<NotificationPosition>(s, out var t);
|
||||||
|
_manager.Position = t;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
|
private void NormalButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Button b && b.Content is string s)
|
if (sender is Button b && b.Content is string s)
|
||||||
@ -32,16 +41,6 @@ public partial class NotificationDemo : UserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PositionButton_OnClick(object? sender, RoutedEventArgs e)
|
|
||||||
{
|
|
||||||
if (sender is Button b && b.Content is string s)
|
|
||||||
{
|
|
||||||
Enum.TryParse<NotificationPosition>(s, out var t);
|
|
||||||
_manager.Position = t;
|
|
||||||
_manager?.Show(new Notification(t.ToString(), "This is message"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void LightButton_OnClick(object? sender, RoutedEventArgs e)
|
private void LightButton_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is Button b && b.Content is string s)
|
if (sender is Button b && b.Content is string s)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user