diff --git a/README.md b/README.md index 9050702..1df0117 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Avalonia Theme inspired by Semi Design ## Installation ```bash -dotnet add package Semi.Avalonia --version 11.0.0-rc1 +dotnet add package Semi.Avalonia --version 11.0.0 ``` Include Semi Design Styles in application: @@ -23,8 +23,8 @@ That's all. DataGrid and ColorPicker are distributed in separated packages. Please install if you need. ```bash -dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0-rc1 -dotnet add package Semi.Avalonia.DataGrid --version 11.0.0-rc1 +dotnet add package Semi.Avalonia.ColorPicker --version 11.0.0 +dotnet add package Semi.Avalonia.DataGrid --version 11.0.0 ``` ```xaml @@ -42,20 +42,9 @@ https://github.com/irihitech/Semi.Avalonia/releases | Semi Design Version | Avalonia Version | |:--------------------|:-----------------| -| 11.0.0-rc1 | 11.0.0-rc1.1 | -| 0.1.0-preview3 | 11.0-preview4 | -| 0.1.0-preview5.x | 11.0-preview5 | -| 0.1.0-preview6.x | 11.0-preview6 | -| 0.1.0-preview7.x | 11.0-preview7 | -| 0.1.0-preview8.x | 11.0-preview8 | - -**NOTE** - -Semi Avalonia theme is moving forward together with Avalonia preview versions now. So new feature/fixes are not backported to previous preview versions. If you need a feature/fix for outdated avalonia preview version, please raise an issue so we can do that for you. - +| 11.0.0 | 11.0.0 | ## TODO -* DataValidationErrors * FocusAdorner ## Credits diff --git a/Semi.Avalonia.sln b/Semi.Avalonia.sln index a9245de..85b5a31 100644 --- a/Semi.Avalonia.sln +++ b/Semi.Avalonia.sln @@ -26,6 +26,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.ColorPicker", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Semi.Avalonia.Demo.Android", "demo\Semi.Avalonia.Demo.Android\Semi.Avalonia.Demo.Android.csproj", "{0C81FC1C-5D2D-478A-9876-923A0C85EC2F}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Semi.Avalonia.Demo.Drm", "demo\Semi.Avalonia.Demo.Drm\Semi.Avalonia.Demo.Drm.csproj", "{86D93406-412A-4429-93B2-92AAD0407784}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -61,6 +63,10 @@ Global {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.ActiveCfg = Release|Any CPU {0C81FC1C-5D2D-478A-9876-923A0C85EC2F}.Release|Any CPU.Build.0 = Release|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Debug|Any CPU.Build.0 = Debug|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.ActiveCfg = Release|Any CPU + {86D93406-412A-4429-93B2-92AAD0407784}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -70,6 +76,7 @@ Global {69A2C77D-6DB7-4AE4-B179-D1F5CF5E2DF0} = {43091528-9509-43CB-A003-9C5C11E96DD6} {D789AEDB-EBDF-4450-8E8E-B4A03FB257B0} = {43091528-9509-43CB-A003-9C5C11E96DD6} {0C81FC1C-5D2D-478A-9876-923A0C85EC2F} = {43091528-9509-43CB-A003-9C5C11E96DD6} + {86D93406-412A-4429-93B2-92AAD0407784} = {43091528-9509-43CB-A003-9C5C11E96DD6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7CA41ED3-2CED-40CC-AA21-28C3B42B1E86} diff --git a/demo/Directory.Build.props b/demo/Directory.Build.props index 5a014d1..ae8bdf5 100644 --- a/demo/Directory.Build.props +++ b/demo/Directory.Build.props @@ -1,6 +1,6 @@ enable - 11.0.0-rc1.1 + 11.0.0 diff --git a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs index 7906c4f..d037305 100644 --- a/demo/Semi.Avalonia.Demo.Android/MainActivity.cs +++ b/demo/Semi.Avalonia.Demo.Android/MainActivity.cs @@ -4,9 +4,9 @@ using Avalonia.Android; namespace Semi.Avalonia.Demo.Android; -[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", Theme = "@style/MyTheme.NoActionBar", - LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize)] -public class MainActivity : AvaloniaMainActivity +[Activity(Label = "Semi.Avalonia.Demo.Android", Icon = "@drawable/Icon", MainLauncher = true, Theme = "@style/MyTheme.NoActionBar", + LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)] +public class MainActivity : AvaloniaMainActivity { } \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs b/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs deleted file mode 100644 index d5b8f09..0000000 --- a/demo/Semi.Avalonia.Demo.Android/SplashActivity.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Android.App; -using Android.Content; -using Avalonia; -using Avalonia.Android; -using Application = Android.App.Application; - -namespace Semi.Avalonia.Demo.Android; - -[Activity(Theme = "@style/MyTheme.Splash", MainLauncher = true, NoHistory = true)] -public class SplashActivity: AvaloniaSplashActivity -{ - protected override AppBuilder CustomizeAppBuilder(AppBuilder builder) - { - return base.CustomizeAppBuilder(builder); - } - - protected override void OnResume() - { - base.OnResume(); - StartActivity(new Intent(Application.Context, typeof(MainActivity))); - } -} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs index e70ba74..d5fe94a 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/App.axaml.cs @@ -1,7 +1,6 @@ using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using Avalonia.Styling; using Semi.Avalonia.Demo.Views; namespace Semi.Avalonia.Demo.Desktop; diff --git a/demo/Semi.Avalonia.Demo.Desktop/Program.cs b/demo/Semi.Avalonia.Demo.Desktop/Program.cs index d42b109..e011c45 100644 --- a/demo/Semi.Avalonia.Demo.Desktop/Program.cs +++ b/demo/Semi.Avalonia.Demo.Desktop/Program.cs @@ -1,7 +1,9 @@ -using System; -using Avalonia; +using Avalonia; using Avalonia.Dialogs; using Avalonia.Media; +using System; +using System.Linq; +using System.Threading; namespace Semi.Avalonia.Demo.Desktop; diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml b/demo/Semi.Avalonia.Demo.Drm/App.axaml new file mode 100644 index 0000000..d4ceb6d --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs new file mode 100644 index 0000000..f436ee6 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/App.axaml.cs @@ -0,0 +1,24 @@ +using Avalonia; +using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Markup.Xaml; +using Semi.Avalonia.Demo.Views; + +namespace Semi.Avalonia.Demo.Drm +{ + public partial class App : Application + { + public override void Initialize() + { + AvaloniaXamlLoader.Load(this); + } + + public override void OnFrameworkInitializationCompleted() + { + if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + desktop.MainWindow = new MainWindow(); + else if (ApplicationLifetime is ISingleViewApplicationLifetime singleView) + singleView.MainView = new MainView(); + base.OnFrameworkInitializationCompleted(); + } + } +} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/Program.cs b/demo/Semi.Avalonia.Demo.Drm/Program.cs new file mode 100644 index 0000000..45d2f66 --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/Program.cs @@ -0,0 +1,59 @@ +using Avalonia; +using Avalonia.Dialogs; +using Avalonia.Media; +using System; +using System.Linq; +using System.Threading; + +namespace Semi.Avalonia.Demo.Drm +{ + internal class Program + { + // Initialization code. Don't use any Avalonia, third-party APIs or any + // SynchronizationContext-reliant code before AppMain is called: things aren't initialized + // yet and stuff might break. + [STAThread] + public static void Main(string[] args) + { + var builder = BuildAvaloniaApp(); + builder.With(new FontManagerOptions + { + FontFallbacks = new[] + { + new FontFallback + { + FontFamily = new FontFamily("Microsoft YaHei") + } + } + }); + if (args.Contains("--drm")) + { + SilenceConsole(); + builder.StartLinuxDrm(args: args, card: "/dev/dri/card0", scaling: 1); + } + else + { + builder.StartWithClassicDesktopLifetime(args); + } + } + + // Avalonia configuration, don't remove; also used by visual designer. + public static AppBuilder BuildAvaloniaApp() + => AppBuilder.Configure() + .UseManagedSystemDialogs() + .UsePlatformDetect() + .With(new Win32PlatformOptions()) + .LogToTrace(); + + private static void SilenceConsole() + { + new Thread(() => + { + Console.CursorVisible = false; + while (true) + Console.ReadKey(true); + }) + { IsBackground = true }.Start(); + } + } +} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj new file mode 100644 index 0000000..7accf7a --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/Semi.Avalonia.Demo.Drm.csproj @@ -0,0 +1,22 @@ + + + WinExe + net7.0 + enable + true + app.manifest + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo.Drm/app.manifest b/demo/Semi.Avalonia.Demo.Drm/app.manifest new file mode 100644 index 0000000..938919a --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/app.manifest @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo.Drm/使用方法.md b/demo/Semi.Avalonia.Demo.Drm/使用方法.md new file mode 100644 index 0000000..efe659a --- /dev/null +++ b/demo/Semi.Avalonia.Demo.Drm/使用方法.md @@ -0,0 +1,51 @@ +# DRM启动步骤 + +(Ubuntu18.04Server版本 虚拟机测试OK) + +Avalonia官方参考文档:https://docs.avaloniaui.net/docs/next/guides/platforms/rpi/running-on-raspbian-lite-via-drm + +1.Linux端运行命令 + sudo apt update + sudo apt upgrade + sudo reboot + sudo apt - get install libgbm1 libgl1 - mesa - dri libegl1 - mesa libinput10 + +2.安装测试工具测试(出现一个彩色立方体说明环境安装完成) + sudo apt-get install kmscube + sudo kmscube + +3.安装.net运行时(参考网址:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website) + +4.新建一个Avalonia项目,nuget里面添加Avalonia.LinuxFramebuffer包 + +5.添加StartLinuxDrm代码(不知道怎么添加看Semi.Avalonia.Demo.Drm项目代码) + +6.发布程序到Linux(安装.net,怎么运行这些省略) + +7.运行 ./Semi.Avalonia.Demo.Drm --drm + +## 报错处理: + +1. 报错内容 + +>Unhandled exception. Avalonia.Markup.Xaml.XamlLoadException: No precompiled XAML found for avares://Semi.Avalonia/Themes/Light/Light.axaml (baseUri: avares://Semi.Avalonia/Themes/Index.axaml), make sure to specify x:Class and include your XAML file as AvaloniaResource + + 解决方法: + 如果使用Semi发布文件不要裁剪,如果裁剪会报错 + + +2. 报错内容 +>Unhandled exception. System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception.** + **--->System.DllNotFoundException: Unable to load shared library 'libSkiaSharp' or one of its dependencies.In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibSkiaSharp: cannot open shared object file: No such file or directory + at SkiaSharp.SkiaApi.sk_colortype_get_default_8888() + at SkiaSharp.SKImageInfo..cctor() + +解决方法: + Linux命令行安装一下 apt-get install -y libfontconfig1 + 参考网址:https://github.com/mono/SkiaSharp/issues/509 + +3. 报错内容 +>Permission denied + +解决方法: + sudo chmod +x ./Semi.Avalonia.Demo.Drm \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml index b7ef18f..204599d 100644 --- a/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/CheckBoxDemo.axaml @@ -26,6 +26,27 @@ Checkbox should wrap its text + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml index d5c312b..07f7cfe 100644 --- a/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/HeaderedContentControlDemo.axaml @@ -6,7 +6,7 @@ x:Class="Semi.Avalonia.Demo.Pages.HeaderedContentControlDemo"> - + Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统。设计系统包含设计语言以及一整套可复用的前端组件,帮助设计师与开发者更容易地打造高质量的、用户体验一致的、符合设计规范的 Web 应用。 diff --git a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml index d5adc3d..90f2676 100644 --- a/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/LabelDemo.axaml @@ -7,77 +7,220 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Code + + + + + + + + + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml index 8148e2e..77d164b 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ProgressBarDemo.axaml @@ -7,114 +7,159 @@ d:DesignHeight="800" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - - - + + + + + + + + + + + + + + + + + + + Value="60" /> - + Value="60" /> + ShowProgressText="True" + Value="60" /> + + + - - - - - - + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml index 59814fc..f884c40 100644 --- a/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/RadioButtonDemo.axaml @@ -23,25 +23,28 @@ 小1 + IsChecked="True" + Theme="{DynamicResource ButtonRadioButton}"> 小2 - + + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 小1 + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 小2 @@ -51,16 +54,19 @@ 默认1 - 默认2 + 默认2 - + - 默认1 + 默认1 + Theme="{DynamicResource ButtonRadioButton}"> 默认2 @@ -72,25 +78,28 @@ 大1 + IsChecked="True" + Theme="{DynamicResource ButtonRadioButton}"> 大2 - + + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 大1 + IsEnabled="False" + Theme="{DynamicResource ButtonRadioButton}"> 大2 @@ -104,7 +113,10 @@ Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 @@ -112,16 +124,19 @@ - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - 单选框标题 @@ -137,7 +152,10 @@ Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 @@ -145,16 +163,19 @@ - + 单选框标题 Semi Design 是由互娱社区前端团队与 UED 团队共同设计开发并维护的设计系统 单选框标题 diff --git a/demo/Semi.Avalonia.Demo/Pages/ScrollViewerDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ScrollViewerDemo.axaml index 00dfd4a..fbacaff 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ScrollViewerDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ScrollViewerDemo.axaml @@ -7,27 +7,69 @@ d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml new file mode 100644 index 0000000..0de5617 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml @@ -0,0 +1,161 @@ + + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Underline + Delete + + Text + + Secondary + + + Tertiary + + + Quaternary + + + Warning + + + Danger + + + Success + + + Default Mark + + + Underline + + + Delete + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + Header 1 + + + Header 2 + + + Header 3 + + + Header 4 + + + Header 5 + + + Header 6 + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs new file mode 100644 index 0000000..b4cc6d7 --- /dev/null +++ b/demo/Semi.Avalonia.Demo/Pages/SelectableTextBlock.axaml.cs @@ -0,0 +1,18 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Semi.Avalonia.Demo.Pages; + +public partial class SelectableTextBlockDemo : UserControl +{ + public SelectableTextBlockDemo() + { + InitializeComponent(); + } + + private void InitializeComponent() + { + AvaloniaXamlLoader.Load(this); + } +} \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml index 7aca219..a5303cc 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TextBlockDemo.axaml @@ -7,82 +7,157 @@ d:DesignHeight="600" d:DesignWidth="800" mc:Ignorable="d"> - - - Styles for TextBlock - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 + + + + + + + + Classes + - + Secondary + Tertiary + Quaternary + Warning + Danger + Success + Mark + Underline + Delete - Text - Secondary - Tertiary - Quaternary - Warning - Warning disabled - Danger - Success - Disabled - Default Mark - Underline - Delete - Underline and Delete - - - Styles for SelectableTextBlock - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 - Header 1 + Text + + Secondary + + + Tertiary + + + Quaternary + + + Warning + + + Danger + + + Success + + + Default Mark + + + Underline + + + Delete + + + + + + Classes + H1 + H2 + H3 + H4 + H5 + H6 + + Header 1 + + + Header 2 + + + Header 3 + + + Header 4 + + + Header 5 + + + Header 6 + + - Text - Secondary - Tertiary - Quaternary - Warning - Warning disabled - Danger - Success - Disabled - Default Mark - Underline - Delete - Underline and Delete + - - Styles for Label - - - - - - - - - - - - - - - - - - - - + diff --git a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml index 4cbba96..9abc6b3 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml @@ -4,53 +4,79 @@ 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:models="using:Semi.Avalonia.Demo.Pages" xmlns:vm="clr-namespace:Semi.Avalonia.Demo.Pages" d:DesignHeight="450" d:DesignWidth="800" x:CompileBindings="True" x:DataType="vm:TreeViewVm" mc:Ignorable="d"> - - - - - - - - - - - - - - Layer 1 - Layer 2 - Layer 3 - - - - - - - - + + + + + + + + + + + + + + + + + Layer 1 + Layer 2 + Layer 3 + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs index 1bd90f7..6674925 100644 --- a/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/TreeViewDemo.axaml.cs @@ -19,6 +19,8 @@ public class TreeViewVm : ObservableObject { public ObservableCollection Items { get; set; } + public ObservableCollection? MultipleLevelItems { get; set; } + public TreeViewVm() { Items = new ObservableCollection() @@ -33,6 +35,25 @@ public class TreeViewVm : ObservableObject }, }, }; + + MultipleLevelItems = new(); + for (int i = 1; i < 6; i++) + { + FirstItem firstItem = new FirstItem { Id = i, Name = $"FirstItem {i}" }; + firstItem.SecondItems = new(); + for (int j = 1; j < 6; j++) + { + SecondItem secondItem = new SecondItem { Id = j, Name = $"SecondItem {j}" }; + secondItem.ThirdItemItems = new(); + for (int k = 1; k < 6; k++) + { + ThirdItem thirdItem = new ThirdItem { Id = k, Name = $"ThirdItem {k}" }; + secondItem.ThirdItemItems.Add(thirdItem); + } + firstItem.SecondItems.Add(secondItem); + } + MultipleLevelItems.Add(firstItem); + } } } @@ -41,4 +62,25 @@ public partial class TreeViewItemVm : ObservableObject public ObservableCollection Items { get; set; } public string Name { get; set; } public string Id { get; set; } -} \ No newline at end of file +} + +public class ItemBase +{ + public int Id { get; set; } + public string? Name { get; set; } +} +public class FirstItem : ItemBase +{ + public ObservableCollection? SecondItems { get; set; } +} +public class SecondItem : ItemBase +{ + public ObservableCollection? ThirdItemItems { get; set; } + +} +public class ThirdItem : ItemBase +{ +} + + + diff --git a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj index 551fe03..8b1e2c3 100644 --- a/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj +++ b/demo/Semi.Avalonia.Demo/Semi.Avalonia.Demo.csproj @@ -18,29 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/demo/Semi.Avalonia.Demo/Views/MainView.axaml b/demo/Semi.Avalonia.Demo/Views/MainView.axaml index 13b37f7..a87d488 100644 --- a/demo/Semi.Avalonia.Demo/Views/MainView.axaml +++ b/demo/Semi.Avalonia.Demo/Views/MainView.axaml @@ -159,6 +159,9 @@ + + + diff --git a/src/Package.props b/src/Package.props index 0143a6e..0dfb90c 100644 --- a/src/Package.props +++ b/src/Package.props @@ -3,11 +3,11 @@ net6.0;netstandard2.0 enable 10 - 11.0.0-rc1 + 11.0.0 IRIHI Technology Avalonia Theme inspired by Semi Design. https://github.com/irihitech/Semi.Avalonia - 11.0.0-rc1.1 + 11.0.0 MIT \ No newline at end of file diff --git a/src/Semi.Avalonia.DataGrid/Dark.axaml b/src/Semi.Avalonia.DataGrid/Dark.axaml index ad74cb4..e8689c5 100644 --- a/src/Semi.Avalonia.DataGrid/Dark.axaml +++ b/src/Semi.Avalonia.DataGrid/Dark.axaml @@ -12,7 +12,7 @@ 1 - + 12 0 0 0 32 @@ -33,7 +33,7 @@ M7.43934 19.7957C6.85355 19.2099 6.85355 18.2601 7.43934 17.6744L13.0962 12.0175L7.43934 6.36065C6.85355 5.77486 6.85355 4.82511 7.43934 4.23933C8.02513 3.65354 8.97487 3.65354 9.56066 4.23933L16.2782 10.9568C16.864 11.5426 16.864 12.4924 16.2782 13.0782L9.56066 19.7957C8.97487 20.3815 8.02513 20.3815 7.43934 19.7957Z - + diff --git a/src/Semi.Avalonia/Controls/CheckBox.axaml b/src/Semi.Avalonia/Controls/CheckBox.axaml index 5bcbe3c..5818ddf 100644 --- a/src/Semi.Avalonia/Controls/CheckBox.axaml +++ b/src/Semi.Avalonia/Controls/CheckBox.axaml @@ -4,11 +4,11 @@ x:CompileBindings="True"> - - + + + - @@ -17,50 +17,45 @@ - - - - - - - + + + + + + + - - + @@ -178,6 +173,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -461,4 +605,4 @@ - + \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ComboBox.axaml b/src/Semi.Avalonia/Controls/ComboBox.axaml index 4692226..57cbb1a 100644 --- a/src/Semi.Avalonia/Controls/ComboBox.axaml +++ b/src/Semi.Avalonia/Controls/ComboBox.axaml @@ -40,8 +40,6 @@ - - @@ -50,8 +48,8 @@ x:Name="Background" Grid.Column="0" Grid.ColumnSpan="2" - MinHeight="{DynamicResource ComboBoxDefaultHeight}" MinWidth="{DynamicResource ComboBoxThemeMinWidth}" + MinHeight="{DynamicResource ComboBoxDefaultHeight}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" @@ -63,7 +61,8 @@ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Foreground="{TemplateBinding Foreground}" - IsVisible="{TemplateBinding SelectionBoxItem,Converter={x:Static ObjectConverters.IsNull}}" + IsVisible="{TemplateBinding SelectionBoxItem, + Converter={x:Static ObjectConverters.IsNull}}" Opacity="0.3" Text="{TemplateBinding PlaceholderText}" /> - + - - @@ -23,7 +21,7 @@ BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}"> - + Large Circle Label - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + - - - - - - - - - - + - - + + + + + + + + + + + @@ -162,7 +162,7 @@ - + @@ -203,45 +203,9 @@ - - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + + - - - - - - - - - - + + + + - + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Semi.Avalonia/Controls/RadioButton.axaml b/src/Semi.Avalonia/Controls/RadioButton.axaml index 289bfd6..e351271 100644 --- a/src/Semi.Avalonia/Controls/RadioButton.axaml +++ b/src/Semi.Avalonia/Controls/RadioButton.axaml @@ -24,6 +24,10 @@ + + + + + + + + + + + + + + + + - - - - + - - - diff --git a/src/Semi.Avalonia/Controls/TextBlock.axaml b/src/Semi.Avalonia/Controls/TextBlock.axaml index bb26c04..7650620 100644 --- a/src/Semi.Avalonia/Controls/TextBlock.axaml +++ b/src/Semi.Avalonia/Controls/TextBlock.axaml @@ -9,7 +9,6 @@ - diff --git a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml index d74a28b..47e8744 100644 --- a/src/Semi.Avalonia/Controls/ToggleSwitch.axaml +++ b/src/Semi.Avalonia/Controls/ToggleSwitch.axaml @@ -15,6 +15,14 @@ + + + + + - - -