diff --git a/demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs b/demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs index 2ae59f0..7475113 100644 --- a/demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs +++ b/demo/Semi.Avalonia.Demo/Constant/ColorTokens.cs @@ -5,8 +5,8 @@ namespace Semi.Avalonia.Demo.Constant; public static class ColorTokens { - public static IReadOnlyList> PrimaryTokens { get; } = new List> - { + public static IReadOnlyList> PrimaryTokens { get; } = + [ new("SemiColorPrimary", "Primary"), new("SemiColorPrimaryPointerover", "Primary Pointerover"), new("SemiColorPrimaryActive", "Primary Active"), @@ -14,130 +14,130 @@ public static class ColorTokens new("SemiColorPrimaryLight", "Primary Light"), new("SemiColorPrimaryLightPointerover", "Primary Light Pointerover"), new("SemiColorPrimaryLightActive", "Primary Light Active"), - }; + ]; - public static IReadOnlyList> SecondaryTokens { get; } = new List> - { + public static IReadOnlyList> SecondaryTokens { get; } = + [ new("SemiColorSecondary", "Secondary"), new("SemiColorSecondaryPointerover", "Secondary Pointerover"), new("SemiColorSecondaryActive", "Secondary Active"), new("SemiColorSecondaryDisabled", "Secondary Disabled"), new("SemiColorSecondaryLight", "Secondary Light"), new("SemiColorSecondaryLightPointerover", "Secondary Light Pointerover"), - new("SemiColorSecondaryLightActive", "Secondary Light Active"), - }; + new("SemiColorSecondaryLightActive", "Secondary Light Active") + ]; - public static IReadOnlyList> TertiaryTokens { get; } = new List> - { + public static IReadOnlyList> TertiaryTokens { get; } = + [ new("SemiColorTertiary", "Tertiary"), new("SemiColorTertiaryPointerover", "Tertiary Pointerover"), new("SemiColorTertiaryActive", "Tertiary Active"), new("SemiColorTertiaryLight", "Tertiary Light"), new("SemiColorTertiaryLightPointerover", "Tertiary Light Pointerover"), - new("SemiColorTertiaryLightActive", "Tertiary Light Active"), - }; + new("SemiColorTertiaryLightActive", "Tertiary Light Active") + ]; - public static IReadOnlyList> InformationTokens { get; } = new List> - { + public static IReadOnlyList> InformationTokens { get; } = + [ new("SemiColorInformation", "Information"), new("SemiColorInformationPointerover", "Information Pointerover"), new("SemiColorInformationActive", "Information Active"), new("SemiColorInformationDisabled", "Information Disabled"), new("SemiColorInformationLight", "Information Light"), new("SemiColorInformationLightPointerover", "Information Light Pointerover"), - new("SemiColorInformationLightActive", "Information Light Active"), - }; + new("SemiColorInformationLightActive", "Information Light Active") + ]; - public static IReadOnlyList> SuccessTokens { get; } = new List> - { + public static IReadOnlyList> SuccessTokens { get; } = + [ new("SemiColorSuccess", "Success"), new("SemiColorSuccessPointerover", "Success Pointerover"), new("SemiColorSuccessActive", "Success Active"), new("SemiColorSuccessDisabled", "Success Disabled"), new("SemiColorSuccessLight", "Success Light"), new("SemiColorSuccessLightPointerover", "Success Light Pointerover"), - new("SemiColorSuccessLightActive", "Success Light Active"), - }; + new("SemiColorSuccessLightActive", "Success Light Active") + ]; - public static IReadOnlyList> WarningTokens { get; } = new List> - { + public static IReadOnlyList> WarningTokens { get; } = + [ new("SemiColorWarning", "Warning"), new("SemiColorWarningPointerover", "Warning Pointerover"), new("SemiColorWarningActive", "Warning Active"), new("SemiColorWarningLight", "Warning Light"), new("SemiColorWarningLightPointerover", "Warning Light Pointerover"), - new("SemiColorWarningLightActive", "Warning Light Active"), - }; + new("SemiColorWarningLightActive", "Warning Light Active") + ]; - public static IReadOnlyList> DangerTokens { get; } = new List> - { + public static IReadOnlyList> DangerTokens { get; } = + [ new("SemiColorDanger", "Danger"), new("SemiColorDangerPointerover", "Danger Pointerover"), new("SemiColorDangerActive", "Danger Active"), new("SemiColorDangerLight", "Danger Light"), new("SemiColorDangerLightPointerover", "Danger Light Pointerover"), - new("SemiColorDangerLightActive", "Danger Light Active"), - }; + new("SemiColorDangerLightActive", "Danger Light Active") + ]; - public static IReadOnlyList> TextTokens { get; } = new List> - { + public static IReadOnlyList> TextTokens { get; } = + [ new("SemiColorText0", "Text 0"), new("SemiColorText1", "Text 1"), new("SemiColorText2", "Text 2"), - new("SemiColorText3", "Text 3"), - }; + new("SemiColorText3", "Text 3") + ]; - public static IReadOnlyList> LinkTokens { get; } = new List> - { + public static IReadOnlyList> LinkTokens { get; } = + [ new("SemiColorLink", "Link"), new("SemiColorLinkPointerover", "Link Pointerover"), new("SemiColorLinkActive", "Link Active"), - new("SemiColorLinkVisited", "Link Visited"), - }; + new("SemiColorLinkVisited", "Link Visited") + ]; - public static IReadOnlyList> BackgroundTokens { get; } = new List> - { + public static IReadOnlyList> BackgroundTokens { get; } = + [ new("SemiColorBackground0", "Background 0"), new("SemiColorBackground1", "Background 1"), new("SemiColorBackground2", "Background 2"), new("SemiColorBackground3", "Background 3"), - new("SemiColorBackground4", "Background 4"), - }; + new("SemiColorBackground4", "Background 4") + ]; - public static IReadOnlyList> FillTokens { get; } = new List> - { + public static IReadOnlyList> FillTokens { get; } = + [ new("SemiColorFill0", "Fill 0"), new("SemiColorFill1", "Fill 1"), - new("SemiColorFill2", "Fill 2"), - }; + new("SemiColorFill2", "Fill 2") + ]; - public static IReadOnlyList> BorderTokens { get; } = new List> - { + public static IReadOnlyList> BorderTokens { get; } = + [ new("SemiColorBorder", "Border"), - new("SemiColorFocusBorder", "Focus Border"), - }; + new("SemiColorFocusBorder", "Focus Border") + ]; - public static IReadOnlyList> DisabledTokens { get; } = new List> - { + public static IReadOnlyList> DisabledTokens { get; } = + [ new("SemiColorDisabledText", "Disabled Text"), new("SemiColorDisabledBorder", "Disabled Border"), new("SemiColorDisabledBackground", "Disabled Background"), - new("SemiColorDisabledFill", "Disabled Fill"), - }; + new("SemiColorDisabledFill", "Disabled Fill") + ]; - public static IReadOnlyList> OtherTokens { get; } = new List> - { + public static IReadOnlyList> OtherTokens { get; } = + [ new("SemiColorWhite", "White"), new("SemiColorBlack", "Black"), new("SemiColorNavBackground", "Navigation Background"), new("SemiColorOverlayBackground", "Overlay Background"), new("SemiColorHighlightBackground", "Highlight Background"), - new("SemiColorHighlight", "Highlight Text"), - }; + new("SemiColorHighlight", "Highlight Text") + ]; - public static IReadOnlyList> ShadowTokens { get; } = new List> - { + public static IReadOnlyList> ShadowTokens { get; } = + [ new("SemiColorShadow", "Shadow"), - new("SemiShadowElevated", "Shadow Elevated"), - }; + new("SemiShadowElevated", "Shadow Elevated") + ]; } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml index c8b7ad6..6fa1c0b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml @@ -6,8 +6,8 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:iri="https://irihi.tech/shared" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - xmlns:pages="clr-namespace:Semi.Avalonia.Demo.Pages" - x:DataType="pages:AboutUsViewModel" + xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" + x:DataType="vm:AboutUsViewModel" x:CompileBindings="True" d:DesignHeight="450" d:DesignWidth="800" diff --git a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs index a1491c3..bbdabcd 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/AboutUs.axaml.cs @@ -1,14 +1,6 @@ -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; +using Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.Pages; @@ -29,32 +21,4 @@ public partial class AboutUs : UserControl vm.Launcher = launcher; } } -} - -public partial class AboutUsViewModel: ObservableObject -{ - public ICommand NavigateCommand { get; set; } - - internal ILauncher? Launcher { get; set; } - - public AboutUsViewModel() - { - NavigateCommand = new AsyncRelayCommand(OnNavigateAsync); - } - - private static readonly IReadOnlyDictionary _keyToUrlMapping = new Dictionary() - { - ["semi"] = "https://github.com/irihitech/Semi.Avalonia", - ["ursa"] = "https://github.com/irihitech/Ursa.Avalonia", - ["mantra"] = "https://www.bilibili.com/video/BV15pfKYbEEQ", - }; - - private async Task OnNavigateAsync(string? arg) - { - if (Launcher is not null && arg is not null && _keyToUrlMapping.TryGetValue(arg.ToLower(), out var uri)) - { - await Launcher.LaunchUriAsync(new Uri(uri)); - } - - } } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml index 7fc2efb..bb33519 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml @@ -3,15 +3,15 @@ xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" - xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" d:DesignHeight="450" d:DesignWidth="800" x:CompileBindings="False" - x:DataType="local:AutoCompleteBoxDemoViewModel" + x:DataType="vm:AutoCompleteBoxDemoViewModel" mc:Ignorable="d"> - + @@ -21,7 +21,7 @@ - + diff --git a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs index f306155..cbc46a5 100644 --- a/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/AutoCompleteBoxDemo.axaml.cs @@ -1,9 +1,5 @@ -using System.Collections.ObjectModel; -using Avalonia; using Avalonia.Controls; -using Avalonia.Markup.Xaml; -using System.Collections.Generic; -using CommunityToolkit.Mvvm.ComponentModel; +using Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.Pages; @@ -14,86 +10,4 @@ public partial class AutoCompleteBoxDemo : UserControl InitializeComponent(); this.DataContext = new AutoCompleteBoxDemoViewModel(); } -} - -public class AutoCompleteBoxDemoViewModel: ObservableObject -{ - public ObservableCollection States { get; set; } - - public AutoCompleteBoxDemoViewModel() - { - States = new ObservableCollection(GetStates()); - - } - - private static List GetStates() - { - return new List - { - new StateData("Alabama", "AL", "Montgomery"), - new StateData("Alaska", "AK", "Juneau"), - new StateData("Arizona", "AZ", "Phoenix"), - new StateData("Arkansas", "AR", "Little Rock"), - new StateData("California", "CA", "Sacramento"), - new StateData("Colorado", "CO", "Denver"), - new StateData("Connecticut", "CT", "Hartford"), - new StateData("Delaware", "DE", "Dover"), - new StateData("Florida", "FL", "Tallahassee"), - new StateData("Georgia", "GA", "Atlanta"), - new StateData("Hawaii", "HI", "Honolulu"), - new StateData("Idaho", "ID", "Boise"), - new StateData("Illinois", "IL", "Springfield"), - new StateData("Indiana", "IN", "Indianapolis"), - new StateData("Iowa", "IA", "Des Moines"), - new StateData("Kansas", "KS", "Topeka"), - new StateData("Kentucky", "KY", "Frankfort"), - new StateData("Louisiana", "LA", "Baton Rouge"), - new StateData("Maine", "ME", "Augusta"), - new StateData("Maryland", "MD", "Annapolis"), - new StateData("Massachusetts", "MA", "Boston"), - new StateData("Michigan", "MI", "Lansing"), - new StateData("Minnesota", "MN", "St. Paul"), - new StateData("Mississippi", "MS", "Jackson"), - new StateData("Missouri", "MO", "Jefferson City"), - new StateData("Montana", "MT", "Helena"), - new StateData("Nebraska", "NE", "Lincoln"), - new StateData("Nevada", "NV", "Carson City"), - new StateData("New Hampshire", "NH", "Concord"), - new StateData("New Jersey", "NJ", "Trenton"), - new StateData("New Mexico", "NM", "Santa Fe"), - new StateData("New York", "NY", "Albany"), - new StateData("North Carolina", "NC", "Raleigh"), - new StateData("North Dakota", "ND", "Bismarck"), - new StateData("Ohio", "OH", "Columbus"), - new StateData("Oklahoma", "OK", "Oklahoma City"), - new StateData("Oregon", "OR", "Salem"), - new StateData("Pennsylvania", "PA", "Harrisburg"), - new StateData("Rhode Island", "RI", "Providence"), - new StateData("South Carolina", "SC", "Columbia"), - new StateData("South Dakota", "SD", "Pierre"), - new StateData("Tennessee", "TN", "Nashville"), - new StateData("Texas", "TX", "Austin"), - new StateData("Utah", "UT", "Salt Lake City"), - new StateData("Vermont", "VT", "Montpelier"), - new StateData("Virginia", "VA", "Richmond"), - new StateData("Washington", "WA", "Olympia"), - new StateData("West Virginia", "WV", "Charleston"), - new StateData("Wisconsin", "WI", "Madison"), - new StateData("Wyoming", "WY", "Cheyenne"), - }; - } -} - -public class StateData -{ - public string Name { get; private set; } - public string Abbreviation { get; private set; } - public string Capital { get; private set; } - - public StateData(string name, string abbreviation, string capital) - { - Name = name; - Abbreviation = abbreviation; - Capital = capital; - } } \ No newline at end of file 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..673dc3d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml @@ -4,12 +4,12 @@ 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:Semi.Avalonia.Demo.Pages" + xmlns:vm="clr-namespace:Semi.Avalonia.Demo.ViewModels" d:DesignHeight="800" d:DesignWidth="800" mc:Ignorable="d"> - + @@ -28,13 +28,13 @@ - - - - - + + + + + @@ -49,4 +49,4 @@ - + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs index 3c8cba2..a92b0ed 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ComboBoxDemo.axaml.cs @@ -1,6 +1,5 @@ -using System.Collections.ObjectModel; using Avalonia.Controls; -using CommunityToolkit.Mvvm.ComponentModel; +using Semi.Avalonia.Demo.ViewModels; namespace Semi.Avalonia.Demo.Pages; @@ -11,9 +10,4 @@ public partial class ComboBoxDemo : UserControl InitializeComponent(); this.DataContext = new ComboBoxDemoViewModel(); } -} - -public class ComboBoxDemoViewModel : ObservableObject -{ - public ObservableCollection Items { get; set; } = ["Ding", "Otter", "Husky", "Mr.17", "Cass"]; } \ 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 - +