diff --git a/demo/Ursa.Demo/Pages/BannerDemo.axaml b/demo/Ursa.Demo/Pages/BannerDemo.axaml
index 91c8f894..9b6c591a 100644
--- a/demo/Ursa.Demo/Pages/BannerDemo.axaml
+++ b/demo/Ursa.Demo/Pages/BannerDemo.axaml
@@ -4,49 +4,65 @@
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:pages="clr-namespace:Ursa.Demo.Pages"
xmlns:u="https://irihi.tech/ursa"
- x:DataType="pages:BannerDemoViewModel"
+ xmlns:vm="clr-namespace:Ursa.Demo.ViewModels"
+ x:DataType="vm:BannerDemoViewModel"
mc:Ignorable="d">
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs b/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs
index cd7b94db..421a235e 100644
--- a/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs
+++ b/demo/Ursa.Demo/Pages/BannerDemo.axaml.cs
@@ -1,7 +1,4 @@
-using System.Collections.ObjectModel;
using Avalonia.Controls;
-using Avalonia.Controls.Notifications;
-using Avalonia.Markup.Xaml;
using Ursa.Demo.ViewModels;
namespace Ursa.Demo.Pages;
@@ -13,44 +10,4 @@ public BannerDemo()
InitializeComponent();
this.DataContext = new BannerDemoViewModel();
}
-
- private void InitializeComponent()
- {
- AvaloniaXamlLoader.Load(this);
- }
-}
-
-public class BannerDemoViewModel : ViewModelBase
-{
- private ObservableCollection? _types;
-
- public ObservableCollection? Types
- {
- get => _types;
- set => SetProperty(ref _types, value);
- }
-
- private NotificationType _selectedType;
-
- public NotificationType SelectedType
- {
- get => _selectedType;
- set => SetProperty(ref _selectedType, value);
- }
-
- private bool _bordered;
-
- public bool Bordered
- {
- get => _bordered;
- set => SetProperty(ref _bordered, value);
- }
-
- public BannerDemoViewModel()
- {
- Types = new ObservableCollection()
- {
- NotificationType.Information, NotificationType.Success, NotificationType.Warning, NotificationType.Error
- };
- }
}
\ No newline at end of file
diff --git a/demo/Ursa.Demo/Pages/MessageBoxDemo.axaml b/demo/Ursa.Demo/Pages/MessageBoxDemo.axaml
index 706c8d52..aca40be1 100644
--- a/demo/Ursa.Demo/Pages/MessageBoxDemo.axaml
+++ b/demo/Ursa.Demo/Pages/MessageBoxDemo.axaml
@@ -13,23 +13,23 @@
-
-
-
+
+
+
-
+
-
-
+
+
-
+
\ No newline at end of file
diff --git a/demo/Ursa.Demo/ViewModels/BannerDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/BannerDemoViewModel.cs
index 34a0ded0..d3331b1c 100644
--- a/demo/Ursa.Demo/ViewModels/BannerDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/BannerDemoViewModel.cs
@@ -1,6 +1,41 @@
+using CommunityToolkit.Mvvm.ComponentModel;
+
namespace Ursa.Demo.ViewModels;
-public class BannerDemoViewModel: ViewModelBase
+public partial class BannerDemoViewModel : ViewModelBase
{
-
+ private string? _oldTitle = string.Empty;
+ private string? _oldContent = string.Empty;
+ [ObservableProperty] private string? _title = "Welcome to Ursa";
+ [ObservableProperty] private string? _content = "This is the Demo of Ursa Banner.";
+ [ObservableProperty] private bool _bordered;
+
+ [ObservableProperty] private bool _setTitleNull = true;
+ [ObservableProperty] private bool _setContentNull = true;
+
+ partial void OnSetTitleNullChanged(bool value)
+ {
+ if (value)
+ {
+ Title = _oldTitle;
+ }
+ else
+ {
+ _oldTitle = Title;
+ Title = null;
+ }
+ }
+
+ partial void OnSetContentNullChanged(bool value)
+ {
+ if (value)
+ {
+ Content = _oldContent;
+ }
+ else
+ {
+ _oldContent = Content;
+ Content = null;
+ }
+ }
}
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Compatibles/Theme.axaml b/src/Ursa.Themes.Semi/Compatibles/Theme.axaml
new file mode 100644
index 00000000..4a08c3a4
--- /dev/null
+++ b/src/Ursa.Themes.Semi/Compatibles/Theme.axaml
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Compatibles/_index.axaml b/src/Ursa.Themes.Semi/Compatibles/_index.axaml
index 75c1bf08..832f0b9c 100644
--- a/src/Ursa.Themes.Semi/Compatibles/_index.axaml
+++ b/src/Ursa.Themes.Semi/Compatibles/_index.axaml
@@ -1,5 +1,6 @@
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Banner.axaml b/src/Ursa.Themes.Semi/Controls/Banner.axaml
index e69fc97e..c0f96ff4 100644
--- a/src/Ursa.Themes.Semi/Controls/Banner.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Banner.axaml
@@ -2,8 +2,18 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
-
+
+
+
+
+
+
@@ -11,19 +21,16 @@
+ ColumnDefinitions="Auto, *">
+ Theme="{DynamicResource InnerPathIcon}"
+ Classes="Large"
+ IsVisible="{TemplateBinding Icon, Converter={x:Static ObjectConverters.IsNull}}" />
-
-
+
+
+
+
+ Margin="{DynamicResource BannerCloseButtonMargin}"
+ HorizontalAlignment="Right"
+ VerticalAlignment="Top"
+ Theme="{DynamicResource OverlayCloseButton}"
+ IsVisible="{TemplateBinding CanClose}" />
@@ -120,4 +120,4 @@
-
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Dialog.axaml b/src/Ursa.Themes.Semi/Controls/Dialog.axaml
index 4689866b..1dcf7cba 100644
--- a/src/Ursa.Themes.Semi/Controls/Dialog.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Dialog.axaml
@@ -76,9 +76,8 @@
@@ -93,8 +92,7 @@
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
@@ -104,8 +102,7 @@
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
@@ -115,8 +112,7 @@
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
@@ -126,17 +122,15 @@
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
@@ -186,8 +180,8 @@
+ Theme="{StaticResource InnerPathIcon}"
+ Data="{DynamicResource SemiIconClose}" />
@@ -409,8 +402,7 @@
Header="{DynamicResource STRING_MENU_BRING_FORWARD}">
@@ -420,8 +412,7 @@
Header="{DynamicResource STRING_MENU_BRING_TO_FRONT}">
@@ -431,8 +422,7 @@
Header="{DynamicResource STRING_MENU_SEND_BACKWARD}">
@@ -442,8 +432,7 @@
Header="{DynamicResource STRING_MENU_SEND_TO_BACK}">
@@ -453,9 +442,8 @@
Header="{DynamicResource STRING_MENU_DIALOG_CLOSE}">
+ Theme="{StaticResource InnerPathIcon}"
+ Data="{DynamicResource SemiIconClose}" />
@@ -588,8 +576,8 @@
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
-
-
-
+ Foreground="{DynamicResource SemiColorText1}"
+ Theme="{StaticResource InnerPathIcon}"
+ Data="{DynamicResource SemiIconClose}" />
+
+
+
+
@@ -37,35 +53,5 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/MessageBox.axaml b/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
index 5797196a..050af3cf 100644
--- a/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
+++ b/src/Ursa.Themes.Semi/Controls/MessageBox.axaml
@@ -3,10 +3,35 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa"
xmlns:helpers="clr-namespace:Irihi.Avalonia.Shared.Helpers;assembly=Irihi.Avalonia.Shared">
-
+
+
+
+
+
+
+
+
+
-
+
@@ -36,99 +61,93 @@
BackgroundSizing="InnerBorderEdge"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
- IsHitTestVisible="False" />
+ IsHitTestVisible="False" />
-
-
-
-
-
-
-
+
-
-
+ IsHitTestVisible="False" />
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+ Grid.Row="2"
+ Margin="24,0,24,24"
+ Spacing="8"
+ HorizontalAlignment="Right"
+ Orientation="Horizontal">
+
+
+
+
+
+
-
+
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Notification.axaml b/src/Ursa.Themes.Semi/Controls/Notification.axaml
index 11d6b804..f33e013b 100644
--- a/src/Ursa.Themes.Semi/Controls/Notification.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Notification.axaml
@@ -84,8 +84,8 @@
@@ -432,32 +432,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Toast.axaml b/src/Ursa.Themes.Semi/Controls/Toast.axaml
index 316dc558..98b03792 100644
--- a/src/Ursa.Themes.Semi/Controls/Toast.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Toast.axaml
@@ -56,8 +56,8 @@
@@ -220,31 +220,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
index bd068cd4..c12914dc 100644
--- a/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
+++ b/src/Ursa.Themes.Semi/Locale/zh-cn.axaml
@@ -6,7 +6,7 @@
上移一层
下移一层
置于底层
- 确认
+ 确定
取消
是
否
@@ -16,7 +16,7 @@
暗色
亮色
跟随系统
- 确认
+ 确定
开始时间
结束时间
diff --git a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml
index df1300fd..93e5a384 100644
--- a/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Shared/Banner.axaml
@@ -6,6 +6,9 @@
3
+ 12
1
0 0 12 0
+ 12 0 0 0
+ 18
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Themes/Shared/MessageBox.axaml b/src/Ursa.Themes.Semi/Themes/Shared/MessageBox.axaml
index fe08ce5e..90fe5aaa 100644
--- a/src/Ursa.Themes.Semi/Themes/Shared/MessageBox.axaml
+++ b/src/Ursa.Themes.Semi/Themes/Shared/MessageBox.axaml
@@ -1,3 +1,3 @@
- 300
+ 320
diff --git a/tests/HeadlessTest.Ursa/Controls/DialogTests/StyleClassTests/StyleClassTests.cs b/tests/HeadlessTest.Ursa/Controls/DialogTests/StyleClassTests/StyleClassTests.cs
index 389912db..c801990e 100644
--- a/tests/HeadlessTest.Ursa/Controls/DialogTests/StyleClassTests/StyleClassTests.cs
+++ b/tests/HeadlessTest.Ursa/Controls/DialogTests/StyleClassTests/StyleClassTests.cs
@@ -76,7 +76,7 @@ public void StyleClass_Changes_Button_Content_With_No_StyleClass()
Assert.DoesNotContain("Custom", dialog.Classes);
var okButton = dialog.GetVisualDescendants().OfType