diff --git a/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml b/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml
new file mode 100644
index 0000000..3b38ce3
--- /dev/null
+++ b/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A
+ B
+ C
+
+
+
+
+
diff --git a/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml.cs b/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml.cs
new file mode 100644
index 0000000..fde13b7
--- /dev/null
+++ b/demo/Ursa.Demo/Dialogs/CustomDemoDialog.axaml.cs
@@ -0,0 +1,13 @@
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Markup.Xaml;
+
+namespace Ursa.Demo.Dialogs;
+
+public partial class CustomDemoDialog : UserControl
+{
+ public CustomDemoDialog()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/demo/Ursa.Demo/Dialogs/DialogWithActionViewModel.cs b/demo/Ursa.Demo/Dialogs/CustomDemoDialogViewModel.cs
similarity index 50%
rename from demo/Ursa.Demo/Dialogs/DialogWithActionViewModel.cs
rename to demo/Ursa.Demo/Dialogs/CustomDemoDialogViewModel.cs
index 6615fb4..55fdb55 100644
--- a/demo/Ursa.Demo/Dialogs/DialogWithActionViewModel.cs
+++ b/demo/Ursa.Demo/Dialogs/CustomDemoDialogViewModel.cs
@@ -1,4 +1,5 @@
-using System;
+using System;
+using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -8,14 +9,30 @@ using Ursa.Controls;
namespace Ursa.Demo.Dialogs;
-public partial class DialogWithActionViewModel: ObservableObject, IDialogContext
+public partial class CustomDemoDialogViewModel : ObservableObject, IDialogContext
{
- [ObservableProperty] private string _title;
- [ObservableProperty] private DateTime _date;
+ [ObservableProperty] private string? _city;
+ [ObservableProperty] private string? _department;
+ [ObservableProperty] private string? _owner;
+ [ObservableProperty] private string? _target;
+
+ public CustomDemoDialogViewModel()
+ {
+ Cities =
+ [
+ "Shanghai", "Beijing", "Hulunbuir", "Shenzhen", "Hangzhou", "Nanjing", "Chengdu", "Wuhan", "Chongqing",
+ "Suzhou", "Tianjin", "Xi'an", "Qingdao", "Dalian"
+ ];
+ OKCommand = new RelayCommand(OK);
+ CancelCommand = new RelayCommand(Cancel);
+ DialogCommand = new AsyncRelayCommand(ShowDialog);
+ }
+
+ public ObservableCollection Cities { get; set; }
public void Close()
{
- RequestClose?.Invoke(this, false);
+ RequestClose?.Invoke(this, null);
}
public event EventHandler