feat: add icon, improve demo.

This commit is contained in:
rabbitism
2024-01-11 22:00:17 +08:00
parent 5eeebb020f
commit ae4323d3fe
8 changed files with 168 additions and 54 deletions

View File

@@ -1,17 +1,32 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
xmlns:vm="using:Ursa.Demo.ViewModels"
x:DataType="vm:MessageBoxDemoViewModel"
x:CompileBindings="True"
x:Class="Ursa.Demo.Pages.MessageBoxDemo">
<UserControl
x:Class="Ursa.Demo.Pages.MessageBoxDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:Ursa.Demo.ViewModels"
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
x:DataType="vm:MessageBoxDemoViewModel"
mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="Button">
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Margin" Value="8"></Setter>
</Style>
</UserControl.Styles>
<StackPanel HorizontalAlignment="Left">
<Button Content="Default" Command="{Binding DefaultMessageBoxCommand}"></Button>
<Button Content="OK" Command="{Binding OkCommand}" ></Button>
<Button Content="OKCancel" Command="{Binding OkCancelCommand}" ></Button>
<Button Content="YesNo" Command="{Binding YesNoCommand}" ></Button>
<Button Content="YesNoCancel" Command="{Binding YesNoCancelCommand}" ></Button>
<ComboBox ItemsSource="{Binding Icons}" SelectedItem="{Binding SelectedIcon}" />
<Button Command="{Binding DefaultMessageBoxCommand}" Content="Default" />
<Button Command="{Binding OkCommand}" Content="OK" />
<Button Command="{Binding OkCancelCommand}" Content="OKCancel" />
<Button Command="{Binding YesNoCommand}" Content="YesNo" />
<Button Command="{Binding YesNoCancelCommand}" Content="YesNoCancel" />
<TextBlock>
<Run Text="Last Clicked Result: "></Run>
<Run Text="{Binding Result}"></Run>
</TextBlock>
</StackPanel>
</UserControl>