From d03fe72fc25b1ac0b91e4ee599ec6f339971a450 Mon Sep 17 00:00:00 2001 From: Zhang Dian <54255897+zdpcdt@users.noreply.github.com> Date: Thu, 29 May 2025 18:40:03 +0800 Subject: [PATCH] misc: format code for consistency and readability. --- .../Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs | 7 +- .../Pages/AutoCompleteBoxDemo.axaml.cs | 9 +- .../Semi.Avalonia.Demo/Pages/BorderDemo.axaml | 2 +- .../Pages/BorderDemo.axaml.cs | 2 - .../Semi.Avalonia.Demo/Pages/ButtonDemo.axaml | 20 ++-- .../Pages/ButtonDemo.axaml.cs | 2 - .../Pages/ButtonSpinnerDemo.axaml | 2 +- .../Pages/ButtonSpinnerDemo.axaml.cs | 3 - .../Pages/CalendarDatePickerDemo.axaml.cs | 2 - .../Pages/CalendarDemo.axaml | 2 +- .../Pages/CalendarDemo.axaml.cs | 7 -- .../Pages/CarouselDemo.axaml.cs | 3 - .../Pages/CheckBoxDemo.axaml.cs | 2 - .../Pages/ColorPickerDemo.axaml.cs | 2 - .../Pages/ComboBoxDemo.axaml | 16 ++-- .../Pages/DataGridDemo.axaml | 96 +++++++++---------- .../Pages/DataGridDemo.axaml.cs | 14 --- .../Pages/DataValidationErrorsDemo.axaml | 2 +- .../Pages/DataValidationErrorsDemo.axaml.cs | 7 -- .../Pages/DatePickerDemo.axaml | 2 +- .../Pages/DatePickerDemo.axaml.cs | 13 --- .../Pages/ExpanderDemo.axaml.cs | 2 - .../Pages/FlyoutDemo.axaml.cs | 3 - .../Pages/GridSplitterDemo.axaml | 2 +- .../Pages/GridSplitterDemo.axaml.cs | 6 -- .../Pages/HyperlinkButtonDemo.axaml.cs | 3 - demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml | 4 +- .../Pages/LabelDemo.axaml.cs | 2 - .../Pages/ListBoxDemo.axaml | 14 +-- .../Pages/ManagedFileChooserDemo.axaml | 2 +- demo/Semi.Avalonia.Demo/Pages/MenuDemo.axaml | 2 +- .../Pages/MenuDemo.axaml.cs | 6 -- .../Pages/NumericUpDownDemo.axaml.cs | 6 -- .../Pages/Overview.axaml.cs | 1 - .../Pages/PathIconDemo.axaml.cs | 4 +- .../Pages/ProgressBarDemo.axaml | 6 +- .../Pages/ProgressBarDemo.axaml.cs | 7 -- .../Pages/RadioButtonDemo.axaml.cs | 2 - .../Pages/RefreshContainerDemo.axaml | 2 +- .../Pages/RepeatButtonDemo.axaml.cs | 2 - .../Pages/ScrollViewerDemo.axaml.cs | 7 -- .../Pages/SelectableTextBlock.axaml | 2 +- .../Pages/SelectableTextBlock.axaml.cs | 6 -- .../Semi.Avalonia.Demo/Pages/SliderDemo.axaml | 2 +- .../Pages/SliderDemo.axaml.cs | 6 -- .../Pages/SplitViewDemo.axaml | 6 +- .../Pages/SplitViewDemo.axaml.cs | 6 -- .../Pages/TabControlDemo.axaml.cs | 2 - .../Pages/TextBlockDemo.axaml | 2 +- .../Pages/TextBlockDemo.axaml.cs | 2 - .../Pages/TextBoxDemo.axaml.cs | 2 - .../Pages/TimePickerDemo.axaml | 8 +- .../Pages/TimePickerDemo.axaml.cs | 7 -- .../Pages/ToggleButtonDemo.axaml.cs | 7 -- .../Pages/ToggleSwitchDemo.axaml.cs | 7 -- .../Pages/ToolTipDemo.axaml.cs | 7 -- .../Pages/TreeViewDemo.axaml | 2 +- .../Pages/TreeViewDemo.axaml.cs | 29 +++--- .../ViewModels/ApplicationViewModel.cs | 3 +- .../TreeDataGridDemo/FilesPageViewModel.cs | 2 +- .../TreeDataGridDemo/SongsPageViewModel.cs | 18 ++-- .../TreeDataGridDemoViewModel.cs | 2 +- .../Semi.Avalonia.Demo/Views/MainWindow.axaml | 2 +- .../Views/MainWindow.axaml.cs | 1 - 64 files changed, 131 insertions(+), 298 deletions(-) diff --git a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs index a1491c3..0f945aa 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs @@ -2,10 +2,8 @@ using System; using System.Collections.Generic; using System.Threading.Tasks; using System.Windows.Input; -using Avalonia; using Avalonia.Controls; using Avalonia.Interactivity; -using Avalonia.Markup.Xaml; using Avalonia.Platform.Storage; using CommunityToolkit.Mvvm.ComponentModel; using CommunityToolkit.Mvvm.Input; @@ -31,10 +29,10 @@ public partial class AboutUs : UserControl } } -public partial class AboutUsViewModel: ObservableObject +public partial class AboutUsViewModel : ObservableObject { public ICommand NavigateCommand { get; set; } - + internal ILauncher? Launcher { get; set; } public AboutUsViewModel() @@ -55,6 +53,5 @@ public partial class AboutUsViewModel: ObservableObject { await Launcher.LaunchUriAsync(new Uri(uri)); } - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs index f306155..7915aaf 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs @@ -1,8 +1,6 @@ -using System.Collections.ObjectModel; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Markup.Xaml; using System.Collections.Generic; +using System.Collections.ObjectModel; +using Avalonia.Controls; using CommunityToolkit.Mvvm.ComponentModel; namespace Semi.Avalonia.Demo.Pages; @@ -16,14 +14,13 @@ public partial class AutoCompleteBoxDemo : UserControl } } -public class AutoCompleteBoxDemoViewModel: ObservableObject +public class AutoCompleteBoxDemoViewModel : ObservableObject { public ObservableCollection States { get; set; } public AutoCompleteBoxDemoViewModel() { States = new ObservableCollection(GetStates()); - } private static List GetStates() diff --git a/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml index 560a9e7..905bebc 100644 --- a/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml @@ -18,4 +18,4 @@ Shadow on Pointerover - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs index da207e8..ed06733 100644 --- a/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/BorderDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml index 2974962..72cc9df 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml @@ -112,14 +112,14 @@ IsEnabled="False" /> - - - - - - - - + + + + + + + + @@ -139,7 +139,7 @@ - + @@ -165,7 +165,7 @@ - + diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml.cs index d9d0940..6ac8b72 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml index 4aa5cd0..83b3be2 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml @@ -32,4 +32,4 @@ Text="A.S.I.A" /> - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml.cs index f562d3e..74e197b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ButtonSpinnerDemo.axaml.cs @@ -1,7 +1,5 @@ using System; -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; @@ -31,7 +29,6 @@ public partial class ButtonSpinnerDemo : UserControl txtBox.Text = _mountains[value]; } - } private readonly string[] _mountains = new[] diff --git a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml.cs index 405ba9b..51627fe 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/CalendarDatePickerDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml index 3a28d0b..8de8341 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml @@ -11,4 +11,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs index 06ac28c..1bf192f 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/CalendarDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; @@ -10,9 +8,4 @@ public partial class CalendarDemo : UserControl { InitializeComponent(); } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs index e785e7a..f154d7a 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/CarouselDemo.axaml.cs @@ -1,7 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Interactivity; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs index cd64fb6..2b2efbe 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml.cs index 6dbfeca..7390cb6 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ColorPickerDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml index d309225..993795b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -28,13 +28,13 @@ - - - - - + + + + + @@ -49,4 +49,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml index a1a9af2..69a0bea 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml @@ -12,54 +12,54 @@ mc:Ignorable="d"> - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - - - + + + - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs index 7af3eb8..6744fb7 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/DataGridDemo.axaml.cs @@ -1,18 +1,4 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.ComponentModel; -using System.Linq; -using Avalonia; -using Avalonia.Collections; using Avalonia.Controls; -using Avalonia.Controls.Primitives; -using Avalonia.Data; -using Avalonia.Input; -using Avalonia.Input.Raw; -using Avalonia.Markup.Xaml; -using Avalonia.Threading; using Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml index a8e1101..ac69aa7 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml @@ -80,4 +80,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml.cs index b012533..e24584d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/DataValidationErrorsDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; @@ -10,9 +8,4 @@ public partial class DataValidationErrorsDemo : UserControl { InitializeComponent(); } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml index cb6c0df..99ecbc4 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml @@ -26,4 +26,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs index 9d7ae48..bbba98e 100644 --- a/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/DatePickerDemo.axaml.cs @@ -1,7 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; -using Avalonia.Media; namespace Semi.Avalonia.Demo.Pages; @@ -11,14 +8,4 @@ public partial class DatePickerDemo : UserControl { InitializeComponent(); } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } - - public override void Render(DrawingContext context) - { - base.Render(context); - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml.cs index 31cf485..8201332 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ExpanderDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml.cs index c6653aa..4ad5f8c 100644 --- a/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/FlyoutDemo.axaml.cs @@ -1,7 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.LogicalTree; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml index 01f9480..e00d976 100644 --- a/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml @@ -39,4 +39,4 @@ CornerRadius="10" /> - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs index b3f1927..d61f5c9 100644 --- a/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/GridSplitterDemo.axaml.cs @@ -1,5 +1,4 @@ using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; @@ -9,9 +8,4 @@ public partial class GridSplitterDemo : UserControl { InitializeComponent(); } - - private void InitializeComponent() - { - AvaloniaXamlLoader.Load(this); - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs index ad93fd0..d871370 100644 --- a/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/HyperlinkButtonDemo.axaml.cs @@ -1,7 +1,4 @@ -using System; -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index 250c794..9a70909 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -31,7 +31,7 @@ VerticalAlignment="Top" ColumnDefinitions="Auto, *" RowDefinitions="*,*,*,*,*,*,*,*,*,*,*"> - Classes + Classes - Secondary Tertiary @@ -221,4 +221,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml.cs index 1b65236..4d16769 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml.cs @@ -1,6 +1,4 @@ -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml index e8b43d4..9a9dfd8 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml @@ -16,7 +16,7 @@ Header="Default"> - + Avalonia @@ -31,7 +31,7 @@ Theme="{DynamicResource GroupBox}" Header="RadioGroupListBox"> - + @@ -40,7 +40,7 @@ WPF - + @@ -93,7 +93,7 @@ - + @@ -101,7 +101,7 @@ WPF - + @@ -117,7 +117,7 @@ Header="CheckGroupListBox"> - + WPF - +