From b69502886f109e040fe3a5211ac316778a4c6709 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Mon, 5 Aug 2024 23:40:23 +0800
Subject: [PATCH 1/2] Revert "feat: remove EnumSelector in demo."
This reverts commit f7dc4d35
---
demo/Ursa.Demo/Pages/DialogDemo.axaml | 4 +--
demo/Ursa.Demo/Pages/DrawerDemo.axaml | 7 ++--
.../Pages/ElasticWrapPanelDemo.axaml | 12 +++----
demo/Ursa.Demo/Pages/FormDemo.axaml | 25 ++++++++-------
demo/Ursa.Demo/Pages/IconButtonDemo.axaml | 21 ++++++------
demo/Ursa.Demo/Pages/ToolBarDemo.axaml | 8 ++---
.../ViewModels/DialogDemoViewModel.cs | 19 -----------
.../ViewModels/DrawerDemoViewModel.cs | 18 -----------
.../ElasticWrapPanelDemoViewModel.cs | 32 +------------------
.../Ursa.Demo/ViewModels/FormDemoViewModel.cs | 21 ------------
.../ViewModels/IconButtonDemoViewModel.cs | 15 ++-------
.../ViewModels/ToolBarDemoViewModel.cs | 10 +-----
12 files changed, 41 insertions(+), 151 deletions(-)
diff --git a/demo/Ursa.Demo/Pages/DialogDemo.axaml b/demo/Ursa.Demo/Pages/DialogDemo.axaml
index 6d5a8b6..8ff3534 100644
--- a/demo/Ursa.Demo/Pages/DialogDemo.axaml
+++ b/demo/Ursa.Demo/Pages/DialogDemo.axaml
@@ -52,11 +52,11 @@
OnContent="Yes" />
-
+
-
+
diff --git a/demo/Ursa.Demo/Pages/DrawerDemo.axaml b/demo/Ursa.Demo/Pages/DrawerDemo.axaml
index 96b1eac..84eb644 100644
--- a/demo/Ursa.Demo/Pages/DrawerDemo.axaml
+++ b/demo/Ursa.Demo/Pages/DrawerDemo.axaml
@@ -6,6 +6,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
+ xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
d:DesignHeight="450"
d:DesignWidth="800"
x:CompileBindings="True"
@@ -15,7 +16,7 @@
-
+
-
+
@@ -48,7 +49,7 @@
-
+
-
@@ -30,13 +30,13 @@
Margin="4 0">
-
+
-
+
-
+
@@ -93,10 +93,10 @@
Value="{Binding ItemSelfHeight}" />
-
+
-
+
diff --git a/demo/Ursa.Demo/Pages/FormDemo.axaml b/demo/Ursa.Demo/Pages/FormDemo.axaml
index a5aeaee..5d63392 100644
--- a/demo/Ursa.Demo/Pages/FormDemo.axaml
+++ b/demo/Ursa.Demo/Pages/FormDemo.axaml
@@ -2,6 +2,7 @@
x:Class="Ursa.Demo.Pages.FormDemo"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:u="https://irihi.tech/ursa"
@@ -14,21 +15,21 @@
-
-
-
-
+
+
+
+
@@ -15,16 +14,14 @@
-
+
@@ -86,7 +83,7 @@
Width="150"
Classes="Warning"
Content="GitHub"
- IconPlacement="{Binding #placement.SelectedValue}"
+ IconPlacement="{Binding #placement.Value}"
IsLoading="{Binding #loading.IsChecked}"
Theme="{DynamicResource SolidIconButton}">
diff --git a/demo/Ursa.Demo/Pages/ToolBarDemo.axaml b/demo/Ursa.Demo/Pages/ToolBarDemo.axaml
index a0b08c1..c852b9c 100644
--- a/demo/Ursa.Demo/Pages/ToolBarDemo.axaml
+++ b/demo/Ursa.Demo/Pages/ToolBarDemo.axaml
@@ -19,13 +19,11 @@
-
+
+ Orientation="{Binding #Orientation.Value}">
@@ -54,7 +52,7 @@
+ Orientation="{Binding #Orientation.Value}">
diff --git a/demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs
index d966e9f..611eba8 100644
--- a/demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/DialogDemoViewModel.cs
@@ -25,25 +25,6 @@ public partial class DialogDemoViewModel: ObservableObject
[ObservableProperty] private DateTime? _date;
[ObservableProperty] private bool _fullScreen;
[ObservableProperty] private bool _showInTaskBar;
-
- public ObservableCollection DialogButtons =>
- [
- DialogButton.None,
- DialogButton.OK,
- DialogButton.OKCancel,
- DialogButton.YesNo,
- DialogButton.YesNoCancel,
- ];
-
- public ObservableCollection DialogModes =>
- [
- DialogMode.Info,
- DialogMode.Warning,
- DialogMode.Error,
- DialogMode.Question,
- DialogMode.None,
- DialogMode.Success,
- ];
public DialogDemoViewModel()
{
diff --git a/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
index 6692252..b525da4 100644
--- a/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
@@ -1,5 +1,4 @@
using System;
-using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Input;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -25,23 +24,6 @@ public partial class DrawerDemoViewModel : ObservableObject
[ObservableProperty] private bool _isModal;
[ObservableProperty] private DateTime? _date;
- public ObservableCollection Positions =>
- [
- Position.Left,
- Position.Top,
- Position.Right,
- Position.Bottom,
- ];
-
- public ObservableCollection DialogButtons =>
- [
- DialogButton.None,
- DialogButton.OK,
- DialogButton.OKCancel,
- DialogButton.YesNo,
- DialogButton.YesNoCancel,
- ];
-
public DrawerDemoViewModel()
{
ShowDialogCommand = new AsyncRelayCommand(ShowDefaultDialog);
diff --git a/demo/Ursa.Demo/ViewModels/ElasticWrapPanelDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/ElasticWrapPanelDemoViewModel.cs
index ce11177..4964f36 100644
--- a/demo/Ursa.Demo/ViewModels/ElasticWrapPanelDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/ElasticWrapPanelDemoViewModel.cs
@@ -1,5 +1,4 @@
-using System.Collections.ObjectModel;
-using Avalonia.Controls.Primitives;
+using Avalonia.Controls.Primitives;
using Avalonia.Layout;
using CommunityToolkit.Mvvm.ComponentModel;
@@ -24,35 +23,6 @@ public partial class ElasticWrapPanelDemoViewModel : ObservableObject
[ObservableProperty] private HorizontalAlignment _cmbHAlign = HorizontalAlignment.Left;
[ObservableProperty] private VerticalAlignment _cmbVAlign = VerticalAlignment.Stretch;
- public ObservableCollection Orientations =>
- [
- Orientation.Horizontal,
- Orientation.Vertical,
- ];
-
- public ObservableCollection ScrollBarVisibilities =>
- [
- ScrollBarVisibility.Auto,
- ScrollBarVisibility.Hidden,
- ScrollBarVisibility.Visible,
- ];
-
- public ObservableCollection HorizontalAlignments =>
- [
- HorizontalAlignment.Left,
- HorizontalAlignment.Center,
- HorizontalAlignment.Right,
- HorizontalAlignment.Stretch,
- ];
-
- public ObservableCollection VerticalAlignments =>
- [
- VerticalAlignment.Top,
- VerticalAlignment.Center,
- VerticalAlignment.Bottom,
- VerticalAlignment.Stretch,
- ];
-
private double _oldItemSelfWidth;
private double _oldItemSelfHeight;
diff --git a/demo/Ursa.Demo/ViewModels/FormDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/FormDemoViewModel.cs
index 9ef65ed..97e1873 100644
--- a/demo/Ursa.Demo/ViewModels/FormDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/FormDemoViewModel.cs
@@ -1,33 +1,12 @@
using System;
-using System.Collections.ObjectModel;
using System.ComponentModel.DataAnnotations;
-using Avalonia.Layout;
using CommunityToolkit.Mvvm.ComponentModel;
-using Ursa.Common;
namespace Ursa.Demo.ViewModels;
public partial class FormDemoViewModel : ObservableObject
{
[ObservableProperty] private DataModel _model;
- [ObservableProperty] private Position _selectedPosition = Position.Top;
- [ObservableProperty] private HorizontalAlignment _selectedHorizontalAlignment = HorizontalAlignment.Left;
-
- public ObservableCollection Positions =>
- [
- Position.Left,
- Position.Top,
- Position.Right,
- Position.Bottom,
- ];
-
- public ObservableCollection HorizontalAlignments =>
- [
- HorizontalAlignment.Stretch,
- HorizontalAlignment.Left,
- HorizontalAlignment.Center,
- HorizontalAlignment.Right,
- ];
public FormDemoViewModel()
{
diff --git a/demo/Ursa.Demo/ViewModels/IconButtonDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/IconButtonDemoViewModel.cs
index 927ff15..dd980fb 100644
--- a/demo/Ursa.Demo/ViewModels/IconButtonDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/IconButtonDemoViewModel.cs
@@ -1,18 +1,7 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using Ursa.Common;
+using CommunityToolkit.Mvvm.ComponentModel;
namespace Ursa.Demo.ViewModels;
-public partial class IconButtonDemoViewModel : ObservableObject
+public class IconButtonDemoViewModel : ObservableObject
{
- [ObservableProperty] private Position _selectedPosition = Position.Top;
-
- public ObservableCollection Positions =>
- [
- Position.Left,
- Position.Top,
- Position.Right,
- Position.Bottom,
- ];
}
\ No newline at end of file
diff --git a/demo/Ursa.Demo/ViewModels/ToolBarDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/ToolBarDemoViewModel.cs
index ce1c71b..5c52bc9 100644
--- a/demo/Ursa.Demo/ViewModels/ToolBarDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/ToolBarDemoViewModel.cs
@@ -1,6 +1,5 @@
using System.Collections.ObjectModel;
using System.Windows.Input;
-using Avalonia.Layout;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Ursa.Controls;
@@ -9,14 +8,6 @@ namespace Ursa.Demo.ViewModels;
public partial class ToolBarDemoViewModel : ObservableObject
{
- [ObservableProperty] private Orientation _selectedOrientation;
-
- public ObservableCollection Orientations =>
- [
- Orientation.Horizontal,
- Orientation.Vertical
- ];
-
public ObservableCollection Items { get; set; }
public ToolBarDemoViewModel()
@@ -76,6 +67,7 @@ public class ToolBarComboBoxItemViewModel : ToolBarItemViewModel
public ObservableCollection? Items { get; set; }
private string? _selectedItem;
+
public string? SelectedItem
{
get => _selectedItem;
From 61d9462db285cacaaa3d3394e855aec064e8f9c8 Mon Sep 17 00:00:00 2001
From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com>
Date: Tue, 6 Aug 2024 00:10:54 +0800
Subject: [PATCH 2/2] misc: remove EnumSelector notice. add AOT compilation
comment.
---
demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj | 5 +++++
demo/Ursa.Demo/Pages/EnumSelectorDemo.axaml | 1 -
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
index ca92927..588bc81 100644
--- a/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
+++ b/demo/Ursa.Demo.Desktop/Ursa.Demo.Desktop.csproj
@@ -7,6 +7,11 @@
enable
true
true
+
+
diff --git a/demo/Ursa.Demo/Pages/EnumSelectorDemo.axaml b/demo/Ursa.Demo/Pages/EnumSelectorDemo.axaml
index 265d0e9..b35256d 100644
--- a/demo/Ursa.Demo/Pages/EnumSelectorDemo.axaml
+++ b/demo/Ursa.Demo/Pages/EnumSelectorDemo.axaml
@@ -12,7 +12,6 @@
x:DataType="vm:EnumSelectorDemoViewModel"
mc:Ignorable="d">
-