mirror of
https://gitee.com/chinware/atomui.git
synced 2024-11-29 18:38:16 +08:00
完成 UI 项目从 ATOMDB 项目剥离
完成 UI 项目从 ATOMDB 项目剥离
This commit is contained in:
commit
05429d4689
199
.gitignore
vendored
Normal file
199
.gitignore
vendored
Normal file
@ -0,0 +1,199 @@
|
||||
#################
|
||||
## Visual Studio
|
||||
#################
|
||||
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
.vs/
|
||||
|
||||
# Build results
|
||||
|
||||
*.sln.ide/
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
x64/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.log
|
||||
*.scc
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.Publish.xml
|
||||
*.pubxml
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# NCrunch
|
||||
.NCrunch_*/
|
||||
_NCrunch_*/
|
||||
*.ncrunchsolution.user
|
||||
nCrunchTemp_*
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.[Pp]ublish.xml
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
App_Data/*.mdf
|
||||
App_Data/*.ldf
|
||||
|
||||
#############
|
||||
## Windows detritus
|
||||
#############
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Mac crap
|
||||
.DS_Store
|
||||
|
||||
#################
|
||||
## Monodevelop
|
||||
#################
|
||||
*.userprefs
|
||||
*.nugetreferenceswitcher
|
||||
|
||||
#################
|
||||
## Rider
|
||||
#################
|
||||
.idea
|
||||
|
||||
#################
|
||||
## VS Code
|
||||
#################
|
||||
.vscode/
|
||||
|
||||
#################
|
||||
## Cake
|
||||
#################
|
||||
tools/*
|
||||
!tools/packages.config
|
||||
.nuget
|
||||
artifacts/
|
||||
nuget
|
||||
project.lock.json
|
||||
.idea/*
|
||||
|
||||
##################
|
||||
## BenchmarkDotNet
|
||||
##################
|
||||
BenchmarkDotNet.Artifacts/
|
||||
dirs.sln
|
||||
|
||||
##################
|
||||
# Xcode
|
||||
##################
|
||||
Index/
|
||||
Logs/
|
||||
ModuleCache.noindex/
|
||||
Build/Intermediates.noindex/
|
||||
build-intermediate
|
||||
obj-Direct2D1/
|
||||
obj-Skia/
|
||||
|
||||
##################
|
||||
# Vim
|
||||
##################
|
||||
.vim
|
||||
coc-settings.json
|
||||
.ccls-cache
|
||||
.ccls
|
||||
*.map
|
||||
node_modules
|
||||
api/diff
|
70
AtomUI.sln
Normal file
70
AtomUI.sln
Normal file
@ -0,0 +1,70 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI", "src\AtomUI\AtomUI.csproj", "{87085491-3C99-4C8F-8FA6-F179B9569CE8}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Base", "src\AtomUI.Base\AtomUI.Base.csproj", "{8FFEB15F-7E48-4AF4-B708-8E96A68CF2D9}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Icon", "src\AtomUI.Icon\AtomUI.Icon.csproj", "{B2A7349B-4B38-45CB-8D22-3E06D1E3650F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Icon.Generator", "src\AtomUI.Icon.Generator\AtomUI.Icon.Generator.csproj", "{954FB7F2-7706-4E2B-86D1-624F66C1EFF0}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Icon.AntDesign", "src\AtomUI.Icon.AntDesign\AtomUI.Icon.AntDesign.csproj", "{021AE0B0-B148-4925-9C22-EBD5A7B43E95}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Generator", "src\AtomUI.Generator\AtomUI.Generator.csproj", "{30910056-F8F6-4429-B25E-722C57440210}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Demo.Desktop", "Samples\AtomUI.Demo.Desktop\AtomUI.Demo.Desktop.csproj", "{59931F42-8DD8-4DFC-9060-563841F39669}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.TestBase", "tests\AtomUI.TestBase\AtomUI.TestBase.csproj", "{EADEF2AC-B7E5-436A-8B39-8BBECF8706AB}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Base.Tests", "tests\AtomUI.Base.Tests\AtomUI.Base.Tests.csproj", "{E41D737A-5CF0-4B33-9F51-2C1B1541659C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AtomUI.Controls", "src\AtomUI.Controls\AtomUI.Controls.csproj", "{A07CB66E-7A5F-4C44-BB16-02A0A99D6C2D}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{87085491-3C99-4C8F-8FA6-F179B9569CE8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{87085491-3C99-4C8F-8FA6-F179B9569CE8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{87085491-3C99-4C8F-8FA6-F179B9569CE8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{87085491-3C99-4C8F-8FA6-F179B9569CE8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8FFEB15F-7E48-4AF4-B708-8E96A68CF2D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8FFEB15F-7E48-4AF4-B708-8E96A68CF2D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8FFEB15F-7E48-4AF4-B708-8E96A68CF2D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8FFEB15F-7E48-4AF4-B708-8E96A68CF2D9}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{B2A7349B-4B38-45CB-8D22-3E06D1E3650F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B2A7349B-4B38-45CB-8D22-3E06D1E3650F}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B2A7349B-4B38-45CB-8D22-3E06D1E3650F}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B2A7349B-4B38-45CB-8D22-3E06D1E3650F}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{954FB7F2-7706-4E2B-86D1-624F66C1EFF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{954FB7F2-7706-4E2B-86D1-624F66C1EFF0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{954FB7F2-7706-4E2B-86D1-624F66C1EFF0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{954FB7F2-7706-4E2B-86D1-624F66C1EFF0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{021AE0B0-B148-4925-9C22-EBD5A7B43E95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{021AE0B0-B148-4925-9C22-EBD5A7B43E95}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{021AE0B0-B148-4925-9C22-EBD5A7B43E95}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{021AE0B0-B148-4925-9C22-EBD5A7B43E95}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{30910056-F8F6-4429-B25E-722C57440210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{30910056-F8F6-4429-B25E-722C57440210}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{30910056-F8F6-4429-B25E-722C57440210}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{30910056-F8F6-4429-B25E-722C57440210}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{59931F42-8DD8-4DFC-9060-563841F39669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{59931F42-8DD8-4DFC-9060-563841F39669}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{59931F42-8DD8-4DFC-9060-563841F39669}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{59931F42-8DD8-4DFC-9060-563841F39669}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EADEF2AC-B7E5-436A-8B39-8BBECF8706AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EADEF2AC-B7E5-436A-8B39-8BBECF8706AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EADEF2AC-B7E5-436A-8B39-8BBECF8706AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EADEF2AC-B7E5-436A-8B39-8BBECF8706AB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E41D737A-5CF0-4B33-9F51-2C1B1541659C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E41D737A-5CF0-4B33-9F51-2C1B1541659C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E41D737A-5CF0-4B33-9F51-2C1B1541659C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{E41D737A-5CF0-4B33-9F51-2C1B1541659C}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{A07CB66E-7A5F-4C44-BB16-02A0A99D6C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{A07CB66E-7A5F-4C44-BB16-02A0A99D6C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{A07CB66E-7A5F-4C44-BB16-02A0A99D6C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{A07CB66E-7A5F-4C44-BB16-02A0A99D6C2D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
EndGlobal
|
20
Directory.Build.props
Normal file
20
Directory.Build.props
Normal file
@ -0,0 +1,20 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<IsTestProject Condition="$(MSBuildProjectFullPath.Contains('test')) and ($(MSBuildProjectName.EndsWith('.Tests')) or $(MSBuildProjectName.EndsWith('.TestBase')))">true</IsTestProject>
|
||||
<AccelerateBuildsInVisualStudio>true</AccelerateBuildsInVisualStudio>
|
||||
<NoWarn>$(NoWarn);CS1591;CS0436</NoWarn>
|
||||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
|
||||
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
|
||||
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
|
||||
<WarningsAsErrors>Nullable</WarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Version>0.0.1-preview</Version>
|
||||
<Company>Chinware Technologies Ltd.</Company>
|
||||
<PackageProjectUrl>https://atomui.net/</PackageProjectUrl>
|
||||
<AvaloniaVersion>11.1.0-rc1</AvaloniaVersion>
|
||||
</PropertyGroup>
|
||||
</Project>
|
30
Directory.Packages.props
Normal file
30
Directory.Packages.props
Normal file
@ -0,0 +1,30 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageVersion Include="Avalonia" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.ColorPicker" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="$(AvaloniaVersion)"/>
|
||||
<PackageVersion Include="Avalonia.Controls.TreeDataGrid" Version="11.0.10"/>
|
||||
<PackageVersion Include="Avalonia.Themes.Fluent" Version="$(AvaloniaVersion)"/>
|
||||
|
||||
<PackageVersion Include="System.Reactive" Version="6.0.1" />
|
||||
|
||||
<!-- 测试相关依赖 -->
|
||||
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0-release-24177-07" />
|
||||
<PackageVersion Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageVersion Include="Shouldly" Version="4.2.1" />
|
||||
<PackageVersion Include="xunit" Version="2.8.0" />
|
||||
<PackageVersion Include="xunit.extensibility.execution" Version="2.8.0" />
|
||||
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
|
||||
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.1.0" />
|
||||
|
||||
<!-- 源码生成 -->
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.10.0-3.final" />
|
||||
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24219.2" />
|
||||
|
||||
</ItemGroup>
|
||||
</Project>
|
8
Samples/AtomUI.Demo.Desktop/App.axaml
Normal file
8
Samples/AtomUI.Demo.Desktop/App.axaml
Normal file
@ -0,0 +1,8 @@
|
||||
<Application
|
||||
x:Class="AtomUI.Demo.Desktop.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Application.Styles>
|
||||
<FluentTheme />
|
||||
</Application.Styles>
|
||||
</Application>
|
29
Samples/AtomUI.Demo.Desktop/App.axaml.cs
Normal file
29
Samples/AtomUI.Demo.Desktop/App.axaml.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using AtomUI.Demo.Desktop.Views;
|
||||
|
||||
namespace AtomUI.Demo.Desktop;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
switch (ApplicationLifetime)
|
||||
{
|
||||
case IClassicDesktopStyleApplicationLifetime desktop:
|
||||
desktop.MainWindow = new MainWindow();
|
||||
break;
|
||||
case ISingleViewApplicationLifetime singleView:
|
||||
singleView.MainView = new MainView();
|
||||
break;
|
||||
}
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
BIN
Samples/AtomUI.Demo.Desktop/Assets/WORLD.png
Normal file
BIN
Samples/AtomUI.Demo.Desktop/Assets/WORLD.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 MiB |
BIN
Samples/AtomUI.Demo.Desktop/Assets/avalonia-logo.ico
Normal file
BIN
Samples/AtomUI.Demo.Desktop/Assets/avalonia-logo.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
36
Samples/AtomUI.Demo.Desktop/AtomUI.Demo.Desktop.csproj
Normal file
36
Samples/AtomUI.Demo.Desktop/AtomUI.Demo.Desktop.csproj
Normal file
@ -0,0 +1,36 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<RootNamespace>AtomUI.Demo.Desktop</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia" />
|
||||
<PackageReference Include="Avalonia.Desktop" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" />
|
||||
<PackageReference Include="Avalonia.Controls.DataGrid" />
|
||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
|
||||
<PackageReference Include="CommunityToolkit.Mvvm" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\AtomUI.Controls\AtomUI.Controls.csproj" />
|
||||
<ProjectReference Include="..\..\src\AtomUI.Icon.AntDesign\AtomUI.Icon.AntDesign.csproj" />
|
||||
<ProjectReference Include="..\..\src\AtomUI\AtomUI.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
60
Samples/AtomUI.Demo.Desktop/Base/ShowCaseItem.cs
Normal file
60
Samples/AtomUI.Demo.Desktop/Base/ShowCaseItem.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public class ShowCaseItem : ContentControl
|
||||
{
|
||||
private bool _initialized = false;
|
||||
public string Title { get; set; } = string.Empty;
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
private void SetupUi()
|
||||
{
|
||||
var mainLayout = new StackPanel();
|
||||
var showCaseTitle = new StackPanel
|
||||
{
|
||||
Orientation = Orientation.Horizontal,
|
||||
Margin = new Thickness(0, 30, 0, 0)
|
||||
};
|
||||
showCaseTitle.Children.Add(new Label()
|
||||
{
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
HorizontalAlignment = HorizontalAlignment.Left,
|
||||
Content = Title,
|
||||
FontWeight = FontWeight.Bold
|
||||
});
|
||||
showCaseTitle.Children.Add(new Separator()
|
||||
{
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
HorizontalAlignment = HorizontalAlignment.Stretch,
|
||||
Margin = new Thickness(10, 0),
|
||||
Width = 200,
|
||||
BorderBrush = new SolidColorBrush(Colors.Gray),
|
||||
});
|
||||
|
||||
if (Content is Control contentControl) {
|
||||
LogicalChildren.Remove(contentControl);
|
||||
mainLayout.Children.Add(contentControl);
|
||||
}
|
||||
|
||||
mainLayout.Children.Add(showCaseTitle);
|
||||
mainLayout.Children.Add(new TextBlock()
|
||||
{
|
||||
Text = Description,
|
||||
TextWrapping = TextWrapping.Wrap
|
||||
});
|
||||
Content = mainLayout;
|
||||
}
|
||||
|
||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||
{
|
||||
if (!_initialized) {
|
||||
SetupUi();
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
}
|
92
Samples/AtomUI.Demo.Desktop/Base/ShowCasePanel.cs
Normal file
92
Samples/AtomUI.Demo.Desktop/Base/ShowCasePanel.cs
Normal file
@ -0,0 +1,92 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Layout;
|
||||
using Avalonia.LogicalTree;
|
||||
using Avalonia.Metadata;
|
||||
using AvaloniaControlList = Avalonia.Controls.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public class ShowCasePanel : Control
|
||||
{
|
||||
public string? Id { get; protected set; }
|
||||
private bool _initialized = false;
|
||||
private StackPanel _leftContainer = default!;
|
||||
private StackPanel _rightContainer = default!;
|
||||
|
||||
[Content]
|
||||
public AvaloniaControlList Children { get; } = new AvaloniaControlList();
|
||||
|
||||
public ShowCasePanel()
|
||||
{
|
||||
}
|
||||
|
||||
protected void SetupUi()
|
||||
{
|
||||
var mainLayout = new UniformGrid()
|
||||
{
|
||||
Rows = 1,
|
||||
Columns = 2,
|
||||
Margin = new Thickness(0)
|
||||
};
|
||||
_leftContainer = new StackPanel()
|
||||
{
|
||||
Orientation = Orientation.Vertical,
|
||||
Spacing = 20,
|
||||
Margin = new Thickness(0, 0, 10, 0),
|
||||
};
|
||||
_rightContainer = new StackPanel()
|
||||
{
|
||||
Orientation = Orientation.Vertical,
|
||||
Spacing = 20,
|
||||
};
|
||||
mainLayout.Children.Add(_leftContainer);
|
||||
mainLayout.Children.Add(_rightContainer);
|
||||
|
||||
for (int i = 0; i < Children.Count; ++i) {
|
||||
var control = Children[i];
|
||||
if (i % 2 == 0) {
|
||||
_leftContainer.Children.Add(control);
|
||||
} else {
|
||||
_rightContainer.Children.Add(control);
|
||||
}
|
||||
}
|
||||
var scrollView = new ScrollViewer()
|
||||
{
|
||||
Content = mainLayout,
|
||||
};
|
||||
LogicalChildren.Add(scrollView);
|
||||
VisualChildren.Add(scrollView);
|
||||
}
|
||||
|
||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||
{
|
||||
if (!_initialized) {
|
||||
SetupUi();
|
||||
NotifyShowCaseLayoutReady();
|
||||
_initialized = true;
|
||||
}
|
||||
base.OnAttachedToLogicalTree(e);
|
||||
}
|
||||
|
||||
internal virtual void NotifyAboutToActive()
|
||||
{
|
||||
}
|
||||
|
||||
internal virtual void NotifyActivated()
|
||||
{
|
||||
}
|
||||
|
||||
internal virtual void NotifyAboutToDeactivated()
|
||||
{
|
||||
}
|
||||
|
||||
internal virtual void NotifyDeactivated()
|
||||
{
|
||||
}
|
||||
|
||||
protected virtual void NotifyShowCaseLayoutReady()
|
||||
{
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ColorItemViewModel">
|
||||
<Design.PreviewWith>
|
||||
<controls:ColorItemControl />
|
||||
</Design.PreviewWith>
|
||||
|
||||
<ControlTheme x:Key="{x:Type controls:ColorItemControl}" TargetType="controls:ColorItemControl">
|
||||
<Setter Property="controls:ColorItemControl.Height" Value="35" />
|
||||
<Setter Property="controls:ColorItemControl.Template">
|
||||
<ControlTemplate TargetType="controls:ColorItemControl">
|
||||
<Border
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<Panel>
|
||||
<TextBlock
|
||||
Padding="8"
|
||||
FontSize="12"
|
||||
FontWeight="600"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{TemplateBinding ColorName}" />
|
||||
<TextBlock
|
||||
Name="PART_HexTextBlock"
|
||||
Padding="8"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="600"
|
||||
FontSize="10"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
IsVisible="False"
|
||||
Opacity="0.8"
|
||||
Text="{TemplateBinding Hex}" />
|
||||
</Panel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover /template/ TextBlock#PART_HexTextBlock">
|
||||
<Setter Property="TextBlock.IsVisible" Value="True" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,38 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Controls;
|
||||
|
||||
public class ColorItemControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string?> ColorNameProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||
nameof(ColorName));
|
||||
|
||||
public string? ColorName
|
||||
{
|
||||
get => GetValue(ColorNameProperty);
|
||||
set => SetValue(ColorNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string?> HexProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||
nameof(Hex));
|
||||
|
||||
public string? Hex
|
||||
{
|
||||
get => GetValue(HexProperty);
|
||||
set => SetValue(HexProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (this.DataContext is ColorItemViewModel v)
|
||||
{
|
||||
WeakReferenceMessenger.Default.Send(v);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ColorListViewModel">
|
||||
|
||||
<ControlTheme x:Key="{x:Type controls:ColorListControl}" TargetType="controls:ColorListControl">
|
||||
<Setter Property="controls:ColorListControl.Template">
|
||||
<ControlTemplate TargetType="controls:ColorListControl">
|
||||
<ItemsControl ItemsSource="{Binding Colors }">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="viewModels:ColorItemViewModel">
|
||||
<controls:ColorItemControl
|
||||
ColorName="{Binding ColorDisplayName}"
|
||||
Background="{Binding Brush}"
|
||||
Foreground="{Binding TextBrush}"
|
||||
Hex="{Binding Hex}" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
</ControlTheme>
|
||||
|
||||
</ResourceDictionary>
|
@ -0,0 +1,17 @@
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Controls;
|
||||
|
||||
public class ColorListControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<ColorListViewModel> ListDataProperty = AvaloniaProperty.Register<ColorListGroupControl, ColorListViewModel>(
|
||||
nameof(ListData), new ColorListViewModel());
|
||||
|
||||
public ColorListViewModel ListData
|
||||
{
|
||||
get => GetValue(ListDataProperty);
|
||||
set => SetValue(ListDataProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:ColorGroupViewModel">
|
||||
|
||||
<ControlTheme x:Key="{x:Type controls:ColorListGroupControl}" TargetType="controls:ColorListGroupControl">
|
||||
<Setter Property="controls:ColorListGroupControl.Template">
|
||||
<ControlTemplate TargetType="controls:ColorListGroupControl">
|
||||
<ItemsControl ItemsSource="{Binding ColorList }">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<UniformGrid Rows="1" Columns="2"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="viewModels:ColorListViewModel">
|
||||
<controls:ColorListControl ListData="{Binding}"
|
||||
Margin="10"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,17 @@
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Controls;
|
||||
|
||||
public class ColorListGroupControl : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<ColorGroupViewModel> GroupDataProperty = AvaloniaProperty.Register<ColorListGroupControl, ColorGroupViewModel>(
|
||||
nameof(GroupData), new ColorGroupViewModel());
|
||||
|
||||
public ColorGroupViewModel GroupData
|
||||
{
|
||||
get => GetValue(GroupDataProperty);
|
||||
set => SetValue(GroupDataProperty, value);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:IconGalleryModel">
|
||||
|
||||
<ControlTheme x:Key="{x:Type controls:IconGallery}" TargetType="controls:IconGallery">
|
||||
<Setter Property="controls:IconGallery.Template">
|
||||
<ControlTemplate TargetType="controls:IconGallery">
|
||||
<ItemsControl ItemsSource="{Binding IconInfos}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="viewModels:IconInfoItemModel">
|
||||
<controls:IconInfoItem
|
||||
IconName ="{Binding IconName}"
|
||||
IconKind="{Binding IconKind}"/>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,50 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Input;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
using AtomUI.Icon;
|
||||
using Avalonia.LogicalTree;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Controls;
|
||||
|
||||
public class IconGallery : TemplatedControl
|
||||
{
|
||||
private bool _initialized = false;
|
||||
private IconGalleryModel _galleryModel;
|
||||
|
||||
public static readonly StyledProperty<IconThemeType?> IconThemeTypeProperty = AvaloniaProperty.Register<IconInfoItem, IconThemeType?>(
|
||||
nameof(IconThemeType));
|
||||
|
||||
public IconThemeType? IconThemeType
|
||||
{
|
||||
get => GetValue(IconThemeTypeProperty);
|
||||
set => SetValue(IconThemeTypeProperty, value);
|
||||
}
|
||||
|
||||
public IconGallery()
|
||||
{
|
||||
_galleryModel = new IconGalleryModel();
|
||||
DataContext = _galleryModel;
|
||||
}
|
||||
|
||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||
{
|
||||
base.OnPointerPressed(e);
|
||||
if (this.DataContext is ColorItemViewModel v) {
|
||||
WeakReferenceMessenger.Default.Send(v);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||
{
|
||||
base.OnAttachedToLogicalTree(e);
|
||||
if (!_initialized) {
|
||||
if (IconThemeType.HasValue) {
|
||||
_galleryModel.LoadThemeIcons(IconThemeType.Value);
|
||||
}
|
||||
_initialized = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
<ResourceDictionary
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="using:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
xmlns:atom="https://atomui.net"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:IconInfoItemModel">
|
||||
|
||||
<ControlTheme x:Key="{x:Type controls:IconInfoItem}" TargetType="controls:IconInfoItem">
|
||||
<Setter Property="Height" Value="150" />
|
||||
<Setter Property="Width" Value="150" />
|
||||
<Setter Property="Margin" Value="10" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate TargetType="controls:IconInfoItem">
|
||||
<Border
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Background="{TemplateBinding Background}">
|
||||
<StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
|
||||
<atom:PathIcon
|
||||
Kind="{Binding IconKind}"
|
||||
Width="48"
|
||||
Height="48">
|
||||
</atom:PathIcon>
|
||||
<TextBlock
|
||||
Margin="0,20, 0, 0"
|
||||
Padding="8"
|
||||
FontSize="13"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Text="{Binding IconName}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<!-- <Style Selector="^:pointerover /template/ TextBlock#PART_HexTextBlock"> -->
|
||||
<!-- <Setter Property="TextBlock.IsVisible" Value="True" /> -->
|
||||
<!-- </Style> -->
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
@ -0,0 +1,25 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Primitives;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Controls;
|
||||
|
||||
public class IconInfoItem : TemplatedControl
|
||||
{
|
||||
public static readonly StyledProperty<string> IconNameProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
||||
nameof(IconName));
|
||||
|
||||
public string IconName
|
||||
{
|
||||
get => GetValue(IconNameProperty);
|
||||
set => SetValue(IconNameProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<string> IconKindProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
||||
nameof(IconKind));
|
||||
|
||||
public string IconKind
|
||||
{
|
||||
get => GetValue(IconKindProperty);
|
||||
set => SetValue(IconKindProperty, value);
|
||||
}
|
||||
}
|
36
Samples/AtomUI.Demo.Desktop/Program.cs
Normal file
36
Samples/AtomUI.Demo.Desktop/Program.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using AtomUI.Icon;
|
||||
using AtomUI.Icon.AntDesign;
|
||||
using Avalonia;
|
||||
using Avalonia.Dialogs;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace AtomUI.Demo.Desktop;
|
||||
|
||||
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) => BuildAvaloniaApp()
|
||||
.With(new FontManagerOptions
|
||||
{
|
||||
FontFallbacks = new[]
|
||||
{
|
||||
new FontFallback
|
||||
{
|
||||
FontFamily = new FontFamily("Microsoft YaHei")
|
||||
}
|
||||
}
|
||||
})
|
||||
.StartWithClassicDesktopLifetime(args);
|
||||
|
||||
public static AppBuilder BuildAvaloniaApp()
|
||||
=> AppBuilder.Configure<App>()
|
||||
.UseManagedSystemDialogs()
|
||||
.UsePlatformDetect()
|
||||
.UseAtomUI()
|
||||
.UseIconPackage<AntDesignIconPackage>(true)
|
||||
.With(new Win32PlatformOptions())
|
||||
.LogToTrace();
|
||||
}
|
5
Samples/AtomUI.Demo.Desktop/Roots.xml
Normal file
5
Samples/AtomUI.Demo.Desktop/Roots.xml
Normal file
@ -0,0 +1,5 @@
|
||||
<linker>
|
||||
<!-- Can be removed if CompiledBinding and no reflection are used -->
|
||||
<assembly fullname="AtomUI.Demo.Desktop" preserve="All" />
|
||||
<assembly fullname="Avalonia.Themes.Fluent" preserve="All" />
|
||||
</linker>
|
157
Samples/AtomUI.Demo.Desktop/ShowCase/AlertShowCase.axaml
Normal file
157
Samples/AtomUI.Demo.Desktop/ShowCase/AlertShowCase.axaml
Normal file
@ -0,0 +1,157 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.AlertShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="The simplest usage for short messages.">
|
||||
<atom:Alert Type="Success">Success Text</atom:Alert>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="More types"
|
||||
Description="There are 4 types of Alert: success, info, warning, error.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:Alert Type="Success">Success Text</atom:Alert>
|
||||
<atom:Alert Type="Info">Info Text</atom:Alert>
|
||||
<atom:Alert Type="Warning">Warning Text</atom:Alert>
|
||||
<atom:Alert Type="Error">Error Text</atom:Alert>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Closable"
|
||||
Description="To show close button.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:Alert Type="Warning" IsClosable="True">
|
||||
Warning Text Warning Text Warning Text Warning Text Warning Text Warning TextWarning Text
|
||||
</atom:Alert>
|
||||
<atom:Alert Type="Error" IsClosable="True"
|
||||
Description="Error Description Error Description Error Description Error Description Error Description Error Description">
|
||||
Error Text
|
||||
</atom:Alert>
|
||||
<atom:Alert Type="Error" IsClosable="True"
|
||||
Description="Error Description Error Description Error Description Error Description Error Description Error Description"
|
||||
CloseIcon="{atom:IconProvider CloseSquareFilled}">
|
||||
Error Text
|
||||
</atom:Alert>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Description"
|
||||
Description="Additional description for alert message.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:Alert Type="Success"
|
||||
Message="Success Text"
|
||||
Description="Success Description Success Description Success Description"/>
|
||||
<atom:Alert Type="Info"
|
||||
Message="Info Text"
|
||||
Description="Info Description Info Description Info Description Info Description"/>
|
||||
<atom:Alert Type="Warning"
|
||||
Message="Warning Text"
|
||||
Description="Warning Description Warning Description Warning Description Warning Description"/>
|
||||
<atom:Alert Type="Error"
|
||||
Message="Error Text"
|
||||
Description="Error Description Error Description Error Description Error Description"/>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Description"
|
||||
Description="Additional description for alert message.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:Alert Type="Success"
|
||||
Message="Success Tips"
|
||||
IsShowIcon="True"/>
|
||||
<atom:Alert Type="Info"
|
||||
Message="Informational Notes"
|
||||
IsShowIcon="True"/>
|
||||
<atom:Alert Type="Warning"
|
||||
Message="Warning"
|
||||
IsShowIcon="True"
|
||||
IsClosable="True"/>
|
||||
<atom:Alert Type="Error"
|
||||
Message="Error"
|
||||
IsShowIcon="True"/>
|
||||
|
||||
<atom:Alert Type="Success"
|
||||
Message="Success Tips"
|
||||
IsShowIcon="True"
|
||||
Description="Detailed description and advice about successful copywriting."/>
|
||||
<atom:Alert Type="Info"
|
||||
Message="Informational Notes"
|
||||
IsShowIcon="True"
|
||||
Description="Additional description and information about copywriting."/>
|
||||
<atom:Alert Type="Warning"
|
||||
Message="Warning"
|
||||
IsClosable="True"
|
||||
IsShowIcon="True"
|
||||
Description="This is a warning notice about copywriting."/>
|
||||
<atom:Alert Type="Error"
|
||||
Message="Error"
|
||||
IsShowIcon="True"
|
||||
Description="This is an error message about copywriting."/>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Custom action"
|
||||
Description="Custom action.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:Alert Type="Success"
|
||||
IsShowIcon="True"
|
||||
IsClosable="true">
|
||||
<atom:Alert.ExtraAction>
|
||||
<atom:Button ButtonType="Text" SizeType="Small">UNDO</atom:Button>
|
||||
</atom:Alert.ExtraAction>
|
||||
Success Tips
|
||||
</atom:Alert>
|
||||
|
||||
<atom:Alert Type="Error"
|
||||
IsShowIcon="True"
|
||||
Description="Error Description Error Description Error Description Error Description">
|
||||
<atom:Alert.ExtraAction>
|
||||
<atom:Button ButtonType="Default" SizeType="Small" IsDanger="True">Detail</atom:Button>
|
||||
</atom:Alert.ExtraAction>
|
||||
Error Text
|
||||
</atom:Alert>
|
||||
|
||||
<atom:Alert Type="Warning"
|
||||
IsClosable="true">
|
||||
<atom:Alert.ExtraAction>
|
||||
<atom:Button ButtonType="Text" SizeType="Small">Done</atom:Button>
|
||||
</atom:Alert.ExtraAction>
|
||||
Warning Text
|
||||
</atom:Alert>
|
||||
|
||||
<atom:Alert Type="Info"
|
||||
IsShowIcon="True"
|
||||
IsClosable="true"
|
||||
Description="Info Description Info Description Info Description Info Description">
|
||||
<atom:Alert.ExtraAction>
|
||||
<StackPanel Orientation="Vertical" Spacing="5">
|
||||
<atom:Button ButtonType="Primary" SizeType="Small">Accept</atom:Button>
|
||||
<atom:Button SizeType="Small" IsDanger="True" IsGhost="True">Decline</atom:Button>
|
||||
</StackPanel>
|
||||
</atom:Alert.ExtraAction>
|
||||
Info Text
|
||||
</atom:Alert>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Loop Banner"
|
||||
Description="Show a loop banner.">
|
||||
<atom:Alert Type="Warning" IsShowIcon="True" IsMessageMarqueEnabled="True">
|
||||
I can be a React component, multiple React components, or just some text, Info Description Info Description Info Description Info Description
|
||||
</atom:Alert>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/AlertShowCase.axaml.cs
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/AlertShowCase.axaml.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class AlertShowCase : UserControl
|
||||
{
|
||||
public AlertShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/AvatarShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/AvatarShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.AvatarShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/AvatarShowCase.axaml.cs
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/AvatarShowCase.axaml.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class AvatarShowCase : UserControl
|
||||
{
|
||||
public AvatarShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/BadgeShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/BadgeShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.BadgeShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/BadgeShowCase.axaml.cs
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/BadgeShowCase.axaml.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class BadgeShowCase : UserControl
|
||||
{
|
||||
public BadgeShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
233
Samples/AtomUI.Demo.Desktop/ShowCase/ButtonShowCase.axaml
Normal file
233
Samples/AtomUI.Demo.Desktop/ShowCase/ButtonShowCase.axaml
Normal file
@ -0,0 +1,233 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ButtonShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCasePanel.Styles>
|
||||
<Style Selector="atom|Button">
|
||||
<Setter Property="Margin" Value="5"></Setter>
|
||||
</Style>
|
||||
</showcase:ShowCasePanel.Styles>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Type"
|
||||
Description="There are primary button, default button, dashed button, text button and link button in antd.">
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary">Primary</atom:Button>
|
||||
<atom:Button>Default</atom:Button>
|
||||
<atom:Button ButtonType="Text">Text</atom:Button>
|
||||
<atom:Button ButtonType="Link">Link</atom:Button>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Button Shape"
|
||||
Description="Supported button shape display, such as primary, default, dashed and Text, etc.">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="0, 0, 0, 20">
|
||||
<atom:Button ButtonType="Primary">Primary</atom:Button>
|
||||
<atom:Button>Default</atom:Button>
|
||||
<atom:Button ButtonType="Text">Text</atom:Button>
|
||||
<atom:Button ButtonType="Link">Link</atom:Button>
|
||||
</WrapPanel>
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal" Margin="0, 0, 0, 20">
|
||||
<atom:Button ButtonType="Primary" Shape="Round">Primary</atom:Button>
|
||||
<atom:Button Shape="Round">Default</atom:Button>
|
||||
<atom:Button ButtonType="Text" Shape="Round">Text</atom:Button>
|
||||
<atom:Button ButtonType="Link" Shape="Round">Link</atom:Button>
|
||||
</WrapPanel>
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Horizontal" Margin="0, 0, 0, 20">
|
||||
<atom:Button ButtonType="Primary" Shape="Circle">AA</atom:Button>
|
||||
<atom:Button Shape="Circle">AA</atom:Button>
|
||||
<atom:Button ButtonType="Text" Shape="Circle">AA</atom:Button>
|
||||
<atom:Button ButtonType="Link" Shape="Circle">AA</atom:Button>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Icon"
|
||||
Description="You can add an icon through the icon property and adjust the position of the icon using iconPosition.">
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary" Shape="Circle">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Primary" Shape="Round">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
Search
|
||||
</atom:Button>
|
||||
|
||||
<atom:Button ButtonType="Default" Shape="Circle">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default" Shape="Round">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
Search
|
||||
</atom:Button>
|
||||
|
||||
<atom:Button ButtonType="Text" Shape="Default">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
Search
|
||||
</atom:Button>
|
||||
|
||||
<atom:Button ButtonType="Link" Shape="Default">
|
||||
<atom:Button.Icon>
|
||||
<atom:PathIcon Kind="SearchOutlined"></atom:PathIcon>
|
||||
</atom:Button.Icon>
|
||||
Search
|
||||
</atom:Button>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Block Button"
|
||||
Description="block property will make the button fit to its parent width.">
|
||||
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Margin="10">
|
||||
<atom:Button ButtonType="Primary">
|
||||
Primary
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default">
|
||||
Default
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Text">
|
||||
Text
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Link">
|
||||
Link
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Danger Buttons"
|
||||
Description="danger is a property of button after antd 4.0.">
|
||||
<WrapPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary" IsDanger="True">
|
||||
Primary
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default" IsDanger="True">
|
||||
Default
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Text" IsDanger="True">
|
||||
Text
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Link" IsDanger="True">
|
||||
Link
|
||||
</atom:Button>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Ghost Button"
|
||||
Description="ghost property will make button's background transparent, it is commonly used in colored background.">
|
||||
<Border Background="rgb(190, 200, 200)"
|
||||
Margin="10"
|
||||
Padding="10">
|
||||
<WrapPanel HorizontalAlignment="Stretch" Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary" IsGhost="True">
|
||||
Primary
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default" IsGhost="True">
|
||||
Default
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Text" IsGhost="True">
|
||||
Text
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Link" IsGhost="True">
|
||||
Link
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Primary" IsDanger="True" IsGhost="True">
|
||||
Danger
|
||||
</atom:Button>
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Disabled"
|
||||
Description="To mark a button as disabled, add the disabled property to the Button.">
|
||||
<WrapPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary">
|
||||
Primary
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Primary" IsEnabled="False">
|
||||
Primary(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Default">
|
||||
Default
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default" IsEnabled="False">
|
||||
Default(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Text">
|
||||
Text
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Text" IsEnabled="False">
|
||||
Text(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Link">
|
||||
Link
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Link" IsEnabled="False">
|
||||
Link(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary" IsDanger="True">
|
||||
Danger Primary
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Primary" IsDanger="True" IsEnabled="False">
|
||||
Danger Primary(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Default" IsDanger="True">
|
||||
Danger Default
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Default" IsDanger="True" IsEnabled="False">
|
||||
Danger Default(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Text" IsDanger="True">
|
||||
Danger Text
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Text" IsDanger="True" IsEnabled="False">
|
||||
Danger Text(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Link" IsDanger="True">
|
||||
Danger Link
|
||||
</atom:Button>
|
||||
<atom:Button ButtonType="Link" IsDanger="True" IsEnabled="False">
|
||||
Danger Link(disabled)
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
11
Samples/AtomUI.Demo.Desktop/ShowCase/ButtonShowCase.axaml.cs
Normal file
11
Samples/AtomUI.Demo.Desktop/ShowCase/ButtonShowCase.axaml.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ButtonShowCase : UserControl
|
||||
{
|
||||
public ButtonShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/CardShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/CardShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.CardShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
11
Samples/AtomUI.Demo.Desktop/ShowCase/CardShowCase.axaml.cs
Normal file
11
Samples/AtomUI.Demo.Desktop/ShowCase/CardShowCase.axaml.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class CardShowCase : UserControl
|
||||
{
|
||||
public CardShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
126
Samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml
Normal file
126
Samples/AtomUI.Demo.Desktop/ShowCase/CheckBoxShowCase.axaml
Normal file
@ -0,0 +1,126 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.CheckBoxShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCasePanel.Styles>
|
||||
<Style Selector="atom|CheckBox">
|
||||
<Setter Property="Margin" Value="0, 0, 5, 5"></Setter>
|
||||
</Style>
|
||||
</showcase:ShowCasePanel.Styles>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="The simplest use.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10">
|
||||
<atom:CheckBox>Checkbox</atom:CheckBox>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Disabled"
|
||||
Description="Disabled checkbox.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:CheckBox IsChecked="False" IsEnabled="False">UnChecked</atom:CheckBox>
|
||||
<atom:CheckBox IsChecked="{x:Null}" IsEnabled="False">Indeterminate</atom:CheckBox>
|
||||
<atom:CheckBox IsChecked="True" IsEnabled="False">Checked</atom:CheckBox>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Controlled Checkbox"
|
||||
Description="Communicated with other components.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:CheckBox IsChecked="{Binding ControlledCheckBoxCheckedStatus}"
|
||||
IsEnabled="{Binding ControlledCheckBoxEnabledStatus}"
|
||||
Command="{Binding CheckBoxHandler}"
|
||||
Content="{Binding ControlledCheckBoxText}" />
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" Margin="0, 10, 0, 0">
|
||||
<atom:Button SizeType="Small" ButtonType="Primary"
|
||||
x:Name="CheckStatusBtn"
|
||||
Command="{Binding CheckStatusHandler}"
|
||||
CommandParameter="{Binding ElementName=CheckStatusBtn}"
|
||||
Text="{Binding CheckStatusBtnText}" />
|
||||
<atom:Button SizeType="Small" ButtonType="Primary"
|
||||
x:Name="EnableStatusBtn"
|
||||
CommandParameter="{Binding ElementName=EnableStatusBtn}"
|
||||
Command="{Binding EnableStatusHandler}"
|
||||
Text="{Binding EnableStatusBtnText}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Checkbox Group"
|
||||
Description="Generate a group of checkboxes from an array.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<WrapPanel Margin="0, 0, 0, 10">
|
||||
<atom:CheckBox IsChecked="True">Apple</atom:CheckBox>
|
||||
<atom:CheckBox IsChecked="True">Pear</atom:CheckBox>
|
||||
<atom:CheckBox IsChecked="True">Orange</atom:CheckBox>
|
||||
</WrapPanel>
|
||||
<WrapPanel Margin="0, 0, 0, 10">
|
||||
<atom:CheckBox>Apple</atom:CheckBox>
|
||||
<atom:CheckBox IsChecked="True">Pear</atom:CheckBox>
|
||||
<atom:CheckBox>Orange</atom:CheckBox>
|
||||
</WrapPanel>
|
||||
<WrapPanel Margin="0, 0, 0, 10">
|
||||
<atom:CheckBox IsChecked="True" IsEnabled="False">Apple</atom:CheckBox>
|
||||
<atom:CheckBox IsEnabled="False">Pear</atom:CheckBox>
|
||||
<atom:CheckBox IsEnabled="False">Orange</atom:CheckBox>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Check all"
|
||||
Description="The indeterminate property can help you to achieve a 'check all' effect.">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left" Spacing="10">
|
||||
<StackPanel>
|
||||
<atom:CheckBox IsChecked="{Binding CheckedAllStatus}"
|
||||
Command="{Binding CheckedAllStatusHandler}">
|
||||
Check all
|
||||
</atom:CheckBox>
|
||||
</StackPanel>
|
||||
<Separator Width="200" />
|
||||
<WrapPanel Margin="0, 20, 0, 0">
|
||||
<atom:CheckBox x:Name="AppleCheckBox"
|
||||
IsChecked="{Binding AppleCheckedStatus}"
|
||||
Command="{Binding CheckedItemStatusHandler}"
|
||||
CommandParameter="{Binding ElementName=AppleCheckBox}">
|
||||
Apple
|
||||
</atom:CheckBox>
|
||||
<atom:CheckBox x:Name="PearCheckBox"
|
||||
IsChecked="{Binding PearCheckedStatus}"
|
||||
Command="{Binding CheckedItemStatusHandler}"
|
||||
CommandParameter="{Binding ElementName=PearCheckBox}">
|
||||
Pear
|
||||
</atom:CheckBox>
|
||||
<atom:CheckBox x:Name="OrangeCheckBox"
|
||||
IsChecked="{Binding OrangeCheckedStatus}"
|
||||
Command="{Binding CheckedItemStatusHandler}"
|
||||
CommandParameter="{Binding ElementName=OrangeCheckBox}">
|
||||
Orange
|
||||
</atom:CheckBox>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Use with Grid"
|
||||
Description="We can use Checkbox and Grid in Checkbox.Group, to implement complex layout.">
|
||||
<Grid ColumnDefinitions="*,*,*" RowDefinitions="Auto,Auto,Auto" Margin="10">
|
||||
<atom:CheckBox Grid.Row="0" Grid.Column="0">A</atom:CheckBox>
|
||||
<atom:CheckBox Grid.Row="0" Grid.Column="1">B</atom:CheckBox>
|
||||
<atom:CheckBox Grid.Row="0" Grid.Column="2">C</atom:CheckBox>
|
||||
<atom:CheckBox Grid.Row="1" Grid.Column="0">D</atom:CheckBox>
|
||||
<atom:CheckBox Grid.Row="1" Grid.Column="1">D</atom:CheckBox>
|
||||
</Grid>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class CheckBoxShowCase : UserControl
|
||||
{
|
||||
public CheckBoxShowCase()
|
||||
{
|
||||
DataContext = new CheckBoxShowCaseModel();
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/ComboBoxShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/ComboBoxShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ComboBoxShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ComboBoxShowCase : UserControl
|
||||
{
|
||||
public ComboBoxShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
22
Samples/AtomUI.Demo.Desktop/ShowCase/EmptyShowCase.axaml
Normal file
22
Samples/AtomUI.Demo.Desktop/ShowCase/EmptyShowCase.axaml
Normal file
@ -0,0 +1,22 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.EmptyShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Demo演示一"
|
||||
Description="There are primary button, default button, dashed button, text button and link button in antd.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Horizontal">
|
||||
<atom:Button ButtonType="Primary">Primary Button</atom:Button>
|
||||
<atom:Button>Default Button</atom:Button>
|
||||
<atom:Button ButtonType="Text">Text Button</atom:Button>
|
||||
<atom:Button ButtonType="Link">Link Button</atom:Button>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
11
Samples/AtomUI.Demo.Desktop/ShowCase/EmptyShowCase.axaml.cs
Normal file
11
Samples/AtomUI.Demo.Desktop/ShowCase/EmptyShowCase.axaml.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class EmptyShowCase : UserControl
|
||||
{
|
||||
public EmptyShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/ExpanderShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/ExpanderShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ExpanderShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ExpanderShowCase : UserControl
|
||||
{
|
||||
public ExpanderShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
41
Samples/AtomUI.Demo.Desktop/ShowCase/IconShowCase.axaml
Normal file
41
Samples/AtomUI.Demo.Desktop/ShowCase/IconShowCase.axaml
Normal file
@ -0,0 +1,41 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.IconShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<viewModels:PaletteDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Controls/PathIcon/IconInfoItem.axaml" />
|
||||
<ResourceInclude Source="../Controls/PathIcon/IconGallery.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<TabControl>
|
||||
<TabItem Header="Outlined">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="Outlined"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Filled">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="Filled"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Two Tone">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="TwoTone"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
25
Samples/AtomUI.Demo.Desktop/ShowCase/IconShowCase.axaml.cs
Normal file
25
Samples/AtomUI.Demo.Desktop/ShowCase/IconShowCase.axaml.cs
Normal file
@ -0,0 +1,25 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Threading;
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class IconShowCase : UserControl
|
||||
{
|
||||
public IconShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
PaletteDemoViewModel vm = new PaletteDemoViewModel();
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
vm.InitializeResources();
|
||||
});
|
||||
DataContext = vm;
|
||||
}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.InputNumberShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class InputNumberShowCase : UserControl
|
||||
{
|
||||
public InputNumberShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/LineEditShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/LineEditShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.LineEditShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class LineEditShowCase : UserControl
|
||||
{
|
||||
public LineEditShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
41
Samples/AtomUI.Demo.Desktop/ShowCase/ListBoxShowCase.axaml
Normal file
41
Samples/AtomUI.Demo.Desktop/ShowCase/ListBoxShowCase.axaml
Normal file
@ -0,0 +1,41 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ListBoxShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<viewModels:PaletteDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Controls/PathIcon/IconInfoItem.axaml" />
|
||||
<ResourceInclude Source="../Controls/PathIcon/IconGallery.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<TabControl>
|
||||
<TabItem Header="Outlined">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="Outlined"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Filled">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="Filled"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Two Tone">
|
||||
<ScrollViewer>
|
||||
<controls:IconGallery IconThemeType="TwoTone"/>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ListBoxShowCase : UserControl
|
||||
{
|
||||
public ListBoxShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/MenuShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/MenuShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.MenuShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
14
Samples/AtomUI.Demo.Desktop/ShowCase/MenuShowCase.axaml.cs
Normal file
14
Samples/AtomUI.Demo.Desktop/ShowCase/MenuShowCase.axaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class MenuShowCase : UserControl
|
||||
{
|
||||
public MenuShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
427
Samples/AtomUI.Demo.Desktop/ShowCase/Overview.axaml
Normal file
427
Samples/AtomUI.Demo.Desktop/ShowCase/Overview.axaml
Normal file
@ -0,0 +1,427 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.Overview"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.Xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
d:DesignHeight="1000"
|
||||
d:DesignWidth="1920"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="Border.CodeBlock">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource SemiColorBorder}" />
|
||||
<Setter Property="Padding" Value="16" />
|
||||
<Setter Property="CornerRadius" Value="6" />
|
||||
<Setter Property="Background" Value="{DynamicResource SemiColorFill0}" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<TextBlock
|
||||
Margin="12,0"
|
||||
FontWeight="600"
|
||||
Text="Welcome AtomUI for Avalonia/.NET" />
|
||||
<!-- <StackPanel Margin="20"> -->
|
||||
<!-- <StackPanel -->
|
||||
<!-- Margin="20" -->
|
||||
<!-- HorizontalAlignment="Center" -->
|
||||
<!-- Orientation="Horizontal"> -->
|
||||
<!-- <PathIcon -->
|
||||
<!-- Width="32" -->
|
||||
<!-- Height="32" -->
|
||||
<!-- Data="M10.6201 17.5C6.06377 17.5 2.37012 13.8063 2.37012 9.25C2.37012 4.69365 6.06377 1 10.6201 1V17.5ZM13.3701 6.5C17.9265 6.5 21.6201 10.1936 21.6201 14.75C21.6201 19.3063 17.9265 23 13.3701 23V6.5Z" /> -->
|
||||
<!-- <PathIcon -->
|
||||
<!-- Width="10" -->
|
||||
<!-- Height="10" -->
|
||||
<!-- Margin="20,0" -->
|
||||
<!-- Data="M20.5 13.5C21.3284 13.5 22 12.8284 22 12C22 11.1716 21.3284 10.5 20.5 10.5L13.5 10.5L13.5 3.5C13.5 2.67157 12.8284 2 12 2C11.1716 2 10.5 2.67157 10.5 3.5L10.5 10.5L3.5 10.5C2.67157 10.5 2 11.1716 2 12C2 12.8284 2.67157 13.5 3.5 13.5L10.5 13.5V20.5C10.5 21.3284 11.1716 22 12 22C12.8284 22 13.5 21.3284 13.5 20.5V13.5L20.5 13.5Z" /> -->
|
||||
<!-- <Image Width="32" Height="32"> -->
|
||||
<!-- <Image.Source> -->
|
||||
<!-- <DrawingImage> -->
|
||||
<!-- <DrawingGroup> -->
|
||||
<!-- <GeometryDrawing Brush="#8B44AC" -->
|
||||
<!-- Geometry="M74.8535 85.8231C75.0263 85.8231 75.1954 85.8231 75.3679 85.8231C80.7347 85.8231 85.1439 81.8027 85.7614 76.6019L85.8357 41.7604C85.2255 18.5931 66.2537 0 42.9393 0C19.2399 0 0.02771 19.2122 0.02771 42.9116C0.02771 66.3573 18.8309 85.418 42.18 85.8231H74.8535Z" /> -->
|
||||
<!-- <GeometryDrawing Brush="#F9F9FB" -->
|
||||
<!-- Geometry="M43.0585 14.6143C29.5513 14.6143 18.2555 24.082 15.4454 36.7432C18.1357 37.4975 20.1087 39.9679 20.1087 42.8992C20.1087 45.8305 18.1357 48.301 15.4454 49.0552C18.2555 61.7164 29.5513 71.1842 43.0585 71.1842C47.9754 71.1842 52.5993 69.9296 56.6276 67.723V70.9926H71.3435V44.0716C71.3569 43.7138 71.3435 43.2603 71.3435 42.8992C71.3435 27.2779 58.6799 14.6143 43.0585 14.6143ZM29.5096 42.8992C29.5096 35.4164 35.5757 29.3503 43.0585 29.3503C50.5414 29.3503 56.6074 35.4164 56.6074 42.8992C56.6074 50.3821 50.5414 56.4481 43.0585 56.4481C35.5757 56.4481 29.5096 50.3821 29.5096 42.8992Z" /> -->
|
||||
<!-- <GeometryDrawing Brush="#F9F9FB" -->
|
||||
<!-- Geometry="M18.105 42.8805C18.105 45.3803 16.0785 47.4068 13.5787 47.4068C11.0789 47.4068 9.05237 45.3803 9.05237 42.8805C9.05237 40.3807 11.0789 38.3542 13.5787 38.3542C16.0785 38.3542 18.105 40.3807 18.105 42.8805Z" /> -->
|
||||
<!-- </DrawingGroup> -->
|
||||
<!-- </DrawingImage> -->
|
||||
<!-- </Image.Source> -->
|
||||
<!-- </Image> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- HorizontalAlignment="Center" -->
|
||||
<!-- Classes="H1" -->
|
||||
<!-- Text="Semi Avalonia" -->
|
||||
<!-- Theme="{DynamicResource TitleTextBlock}" /> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- MaxWidth="600" -->
|
||||
<!-- Margin="0,20,0,0" -->
|
||||
<!-- HorizontalAlignment="Center" -->
|
||||
<!-- Classes="Secondary" -->
|
||||
<!-- Text="AvaloniaUI Theme inspired by Semi Design. An easy-to-customize modern design system that helps designers and developers create high-quality products." -->
|
||||
<!-- TextWrapping="Wrap" /> -->
|
||||
<!-- <StackPanel -->
|
||||
<!-- Margin="0,10,0,0" -->
|
||||
<!-- HorizontalAlignment="Center" -->
|
||||
<!-- Orientation="Horizontal"> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- Margin="12,0" -->
|
||||
<!-- FontWeight="600" -->
|
||||
<!-- Text="Modern" /> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- Margin="12,0" -->
|
||||
<!-- FontWeight="600" -->
|
||||
<!-- Foreground="{Binding #color.Color, Converter={StaticResource ColorToBrushConverter}, Mode=TwoWay}" -->
|
||||
<!-- Text="Flexible" /> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- Margin="12,0" -->
|
||||
<!-- FontWeight="600" -->
|
||||
<!-- Text="Simple" /> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <StackPanel HorizontalAlignment="Center"> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <StackPanel Orientation="Horizontal"> -->
|
||||
<!-- <StackPanel Margin="16,0"> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Primary" -->
|
||||
<!-- Content="Primary" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Secondary" -->
|
||||
<!-- Content="Secondary" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Tertiary" -->
|
||||
<!-- Content="Tertiary" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Success" -->
|
||||
<!-- Content="Success" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Warning" -->
|
||||
<!-- Content="Warning" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- Classes="Danger" -->
|
||||
<!-- Content="Danger" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Theme="{DynamicResource SolidButton}" /> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <Calendar Margin="16,0" /> -->
|
||||
<!-- <StackPanel Margin="16,0"> -->
|
||||
<!-- <TextBox -->
|
||||
<!-- Width="300" -->
|
||||
<!-- Margin="0,12" -->
|
||||
<!-- InnerLeftContent="https://" -->
|
||||
<!-- InnerRightContent=".com" /> -->
|
||||
<!-- <DatePicker Width="300" Margin="0,12" /> -->
|
||||
<!-- <CalendarDatePicker Width="300" Margin="0,12" /> -->
|
||||
<!-- <NumericUpDown Width="300" Margin="0,12" /> -->
|
||||
<!-- <ComboBox Width="300" Margin="0,12"> -->
|
||||
<!-- <ComboBoxItem>Avalonia</ComboBoxItem> -->
|
||||
<!-- <ComboBoxItem>Semi Design</ComboBoxItem> -->
|
||||
<!-- <ComboBoxItem>IRIHI Technology</ComboBoxItem> -->
|
||||
<!-- </ComboBox> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <UniformGrid HorizontalAlignment="Center" Columns="3"> -->
|
||||
<!-- <UniformGrid.Styles> -->
|
||||
<!-- <Style Selector="CheckBox"> -->
|
||||
<!-- <Setter Property="Margin" Value="4" /> -->
|
||||
<!-- </Style> -->
|
||||
<!-- </UniformGrid.Styles> -->
|
||||
<!-- <CheckBox Content="Windows" IsChecked="True" /> -->
|
||||
<!-- <CheckBox Content="macOS" IsChecked="True" /> -->
|
||||
<!-- <CheckBox Content="Linux" IsChecked="True" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="iOS" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Android" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Wasm" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" /> -->
|
||||
<!-- </UniformGrid> -->
|
||||
<!-- <UniformGrid HorizontalAlignment="Center" Columns="3"> -->
|
||||
<!-- <UniformGrid.Styles> -->
|
||||
<!-- <Style Selector="CheckBox"> -->
|
||||
<!-- <Setter Property="Margin" Value="4" /> -->
|
||||
<!-- </Style> -->
|
||||
<!-- </UniformGrid.Styles> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Windows" -->
|
||||
<!-- IsChecked="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="macOS" -->
|
||||
<!-- IsChecked="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Linux" -->
|
||||
<!-- IsChecked="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="iOS" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Android" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- <CheckBox -->
|
||||
<!-- Content="Wasm" -->
|
||||
<!-- IsChecked="{x:Null}" -->
|
||||
<!-- IsThreeState="True" -->
|
||||
<!-- Theme="{DynamicResource CardCheckBox}" /> -->
|
||||
<!-- </UniformGrid> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <StackPanel Orientation="Horizontal"> -->
|
||||
<!-- <StackPanel Margin="16,0"> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Primary" -->
|
||||
<!-- Content="Primary" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Secondary" -->
|
||||
<!-- Content="Secondary" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Tertiary" -->
|
||||
<!-- Content="Tertiary" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Success" -->
|
||||
<!-- Content="Success" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Warning" -->
|
||||
<!-- Content="Warning" /> -->
|
||||
<!-- <Button -->
|
||||
<!-- Margin="0,8" -->
|
||||
<!-- HorizontalAlignment="Stretch" -->
|
||||
<!-- Classes="Danger" -->
|
||||
<!-- Content="Danger" /> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <ColorView -->
|
||||
<!-- Name="color" -->
|
||||
<!-- VerticalAlignment="Top" -->
|
||||
<!-- Palette="{DynamicResource SemiColorPalette}" -->
|
||||
<!-- SelectedIndex="2" -->
|
||||
<!-- Color="#8B44AC" /> -->
|
||||
<!-- <StackPanel Width="300" Margin="8"> -->
|
||||
<!-- <StackPanel Orientation="Horizontal"> -->
|
||||
<!-- <Slider -->
|
||||
<!-- Name="slider" -->
|
||||
<!-- Width="200" -->
|
||||
<!-- Margin="16" -->
|
||||
<!-- Maximum="100" -->
|
||||
<!-- Minimum="0" /> -->
|
||||
<!-- <ToggleSwitch Name="three" IsChecked="True" /> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <UniformGrid Columns="2"> -->
|
||||
<!-- <ProgressBar -->
|
||||
<!-- Width="100" -->
|
||||
<!-- MinWidth="100" -->
|
||||
<!-- Margin="0,16" -->
|
||||
<!-- IsIndeterminate="{Binding #three.IsChecked}" -->
|
||||
<!-- ShowProgressText="True" -->
|
||||
<!-- Value="{Binding #slider.Value}" /> -->
|
||||
<!-- <ProgressBar -->
|
||||
<!-- Width="100" -->
|
||||
<!-- Height="100" -->
|
||||
<!-- IsIndeterminate="{Binding #three.IsChecked}" -->
|
||||
<!-- ShowProgressText="True" -->
|
||||
<!-- Theme="{DynamicResource ProgressRing}" -->
|
||||
<!-- Value="{Binding #slider.Value}" /> -->
|
||||
<!-- </UniformGrid> -->
|
||||
<!-- <TabStrip Margin="0,8"> -->
|
||||
<!-- <TabStripItem Content="Tab 1" /> -->
|
||||
<!-- <TabStripItem Content="Tab 2" /> -->
|
||||
<!-- <TabStripItem Content="Tab 3" /> -->
|
||||
<!-- </TabStrip> -->
|
||||
<!-- <Menu Margin="0,8"> -->
|
||||
<!-- <MenuItem Header="Menu 1"> -->
|
||||
<!-- <MenuItem Header="SubMenu 1" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 2" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 3" /> -->
|
||||
<!-- </MenuItem> -->
|
||||
<!-- <MenuItem Header="Menu 2"> -->
|
||||
<!-- <MenuItem Header="SubMenu 1" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 2" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 3" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 4"> -->
|
||||
<!-- <MenuItem Header="SubMenu 1" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 2" /> -->
|
||||
<!-- <MenuItem Header="SubMenu 3" /> -->
|
||||
<!-- </MenuItem> -->
|
||||
<!-- </MenuItem> -->
|
||||
<!-- <MenuItem Header="Menu 3" /> -->
|
||||
<!-- </Menu> -->
|
||||
<!-- -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <StackPanel Margin="8"> -->
|
||||
<!-- -->
|
||||
<!-- <UniformGrid HorizontalAlignment="Center" Columns="3"> -->
|
||||
<!-- <UniformGrid.Styles> -->
|
||||
<!-- <Style Selector="RadioButton"> -->
|
||||
<!-- <Setter Property="Margin" Value="4" /> -->
|
||||
<!-- <Setter Property="HorizontalAlignment" Value="Center" /> -->
|
||||
<!-- </Style> -->
|
||||
<!-- </UniformGrid.Styles> -->
|
||||
<!-- <RadioButton Content="Avalonia" IsChecked="True" /> -->
|
||||
<!-- <RadioButton Content="WPF" /> -->
|
||||
<!-- <RadioButton Content="Xamarin" /> -->
|
||||
<!-- </UniformGrid> -->
|
||||
<!-- <UniformGrid HorizontalAlignment="Center" Columns="3"> -->
|
||||
<!-- <UniformGrid.Styles> -->
|
||||
<!-- <Style Selector="RadioButton"> -->
|
||||
<!-- <Setter Property="Margin" Value="4" /> -->
|
||||
<!-- <Setter Property="HorizontalAlignment" Value="Center" /> -->
|
||||
<!-- </Style> -->
|
||||
<!-- </UniformGrid.Styles> -->
|
||||
<!-- <RadioButton -->
|
||||
<!-- Content="Avalonia" -->
|
||||
<!-- IsChecked="True" -->
|
||||
<!-- Theme="{DynamicResource CardRadioButton}" /> -->
|
||||
<!-- <RadioButton Content="WPF" Theme="{DynamicResource CardRadioButton}" /> -->
|
||||
<!-- <RadioButton Content="Xamarin" Theme="{DynamicResource CardRadioButton}" /> -->
|
||||
<!-- </UniformGrid> -->
|
||||
<!-- <WrapPanel Width="300"> -->
|
||||
<!-- <WrapPanel.Styles> -->
|
||||
<!-- <Style Selector="Label"> -->
|
||||
<!-- <Setter Property="Margin" Value="4" /> -->
|
||||
<!-- <Setter Property="HorizontalContentAlignment" Value="Center" /> -->
|
||||
<!-- </Style> -->
|
||||
<!-- </WrapPanel.Styles> -->
|
||||
<!-- <Label Classes="Red" Theme="{StaticResource TagLabel}">Red</Label> -->
|
||||
<!-- <Label Classes="Pink" Theme="{StaticResource TagLabel}">Pink</Label> -->
|
||||
<!-- <Label Classes="Purple" Theme="{StaticResource TagLabel}">Purple</Label> -->
|
||||
<!-- <Label Classes="Violet" Theme="{StaticResource TagLabel}">Violet</Label> -->
|
||||
<!-- <Label Classes="Indigo" Theme="{StaticResource TagLabel}">Indigo</Label> -->
|
||||
<!-- <Label Classes="Blue" Theme="{StaticResource TagLabel}">Blue</Label> -->
|
||||
<!-- <Label Classes="LightBlue" Theme="{StaticResource TagLabel}">LightBlue</Label> -->
|
||||
<!-- <Label Classes="Cyan" Theme="{StaticResource TagLabel}">Cyan</Label> -->
|
||||
<!-- <Label Classes="Teal" Theme="{StaticResource TagLabel}">Teal</Label> -->
|
||||
<!-- <Label Classes="Green" Theme="{StaticResource TagLabel}">Green</Label> -->
|
||||
<!-- <Label Classes="LightGreen" Theme="{StaticResource TagLabel}">LightGreen</Label> -->
|
||||
<!-- <Label Classes="Lime" Theme="{StaticResource TagLabel}">Lime</Label> -->
|
||||
<!-- <Label Classes="Yellow" Theme="{StaticResource TagLabel}">Yellow</Label> -->
|
||||
<!-- <Label Classes="Amber" Theme="{StaticResource TagLabel}">Amber</Label> -->
|
||||
<!-- <Label Classes="Orange" Theme="{StaticResource TagLabel}">Orange</Label> -->
|
||||
<!-- <Label Classes="Grey" Theme="{StaticResource TagLabel}">Grey</Label> -->
|
||||
<!-- <Label Classes="White" Theme="{StaticResource TagLabel}">White</Label> -->
|
||||
<!-- <Label Classes="Large" Theme="{StaticResource TagLabel}">Large</Label> -->
|
||||
<!-- <Label Classes="Circle" Theme="{StaticResource TagLabel}">Circle</Label> -->
|
||||
<!-- </WrapPanel> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- <TextBlock -->
|
||||
<!-- Margin="0,32,0,16" -->
|
||||
<!-- Classes="H5" -->
|
||||
<!-- Text="Start to install" -->
|
||||
<!-- Theme="{DynamicResource TitleTextBlock}" /> -->
|
||||
<!-- <TabControl Padding="8"> -->
|
||||
<!-- <TabItem Header="Main"> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <TextBlock Text="Install via nuget: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].MainInstall}" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- <TextBlock Text="Reference styles: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock -->
|
||||
<!-- FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].MainStyle}" -->
|
||||
<!-- TextWrapping="Wrap" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </TabItem> -->
|
||||
<!-- <TabItem Header="ColorPicker"> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <TextBlock Text="Install via nuget: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].ColorPickerInstall}" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- <TextBlock Text="Reference styles: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock -->
|
||||
<!-- FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].ColorPickerStyle}" -->
|
||||
<!-- TextWrapping="Wrap" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </TabItem> -->
|
||||
<!-- <TabItem Header="DataGrid"> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <TextBlock Text="Install via nuget: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].DataGridInstall}" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- <TextBlock Text="Reference styles: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock -->
|
||||
<!-- FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].DataGridStyle}" -->
|
||||
<!-- TextWrapping="Wrap" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </TabItem> -->
|
||||
<!-- <TabItem Header="TreeDataGrid"> -->
|
||||
<!-- <StackPanel> -->
|
||||
<!-- <TextBlock Text="Install via nuget: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].TreeDataGridInstall}" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- <TextBlock Text="Reference styles: " /> -->
|
||||
<!-- <Border Margin="0,16" Classes="CodeBlock"> -->
|
||||
<!-- <SelectableTextBlock -->
|
||||
<!-- FontFamily="Consolas" -->
|
||||
<!-- Text="{Binding $parent[local:Overview].TreeDataGridStyle}" -->
|
||||
<!-- TextWrapping="Wrap" /> -->
|
||||
<!-- </Border> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </TabItem> -->
|
||||
<!-- </TabControl> -->
|
||||
<!-- </StackPanel> -->
|
||||
<!-- </StackPanel> -->
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
47
Samples/AtomUI.Demo.Desktop/ShowCase/Overview.axaml.cs
Normal file
47
Samples/AtomUI.Demo.Desktop/ShowCase/Overview.axaml.cs
Normal file
@ -0,0 +1,47 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Styling;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class Overview : UserControl
|
||||
{
|
||||
public Overview()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public string MainInstall { get; set; } = "dotnet add package AtomUI --version 11.0.7";
|
||||
|
||||
public string MainStyle { get; set; } = """
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://AtomUI/Themes/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string ColorPickerInstall { get; set; } = "dotnet add package AtomUI.ColorPicker --version 11.0.7";
|
||||
|
||||
public string ColorPickerStyle { get; set; } = """
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://AtomUI.ColorPicker/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string DataGridInstall { get; set; } = "dotnet add package AtomUI.DataGrid --version 11.0.7";
|
||||
|
||||
public string DataGridStyle { get; set; } = """
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://AtomUI.DataGrid/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
|
||||
public string TreeDataGridInstall { get; set; } = "dotnet add package AtomUI.TreeDataGrid --version 11.0.7";
|
||||
|
||||
public string TreeDataGridStyle { get; set; } = """
|
||||
<Application.Styles>
|
||||
<StyleInclude Source="avares://AtomUI.TreeDataGrid/Index.axaml" />
|
||||
</Application.Styles>
|
||||
""";
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.PaginationShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class PaginationShowCase : UserControl
|
||||
{
|
||||
public PaginationShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
65
Samples/AtomUI.Demo.Desktop/ShowCase/PaletteShowCase.axaml
Normal file
65
Samples/AtomUI.Demo.Desktop/ShowCase/PaletteShowCase.axaml
Normal file
@ -0,0 +1,65 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.PaletteShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:AtomUI.Demo.Desktop.Controls"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:viewModels="clr-namespace:AtomUI.Demo.Desktop.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
x:DataType="viewModels:PaletteDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<Design.DataContext>
|
||||
<viewModels:PaletteDemoViewModel />
|
||||
</Design.DataContext>
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
||||
<ResourceInclude Source="../Controls/Colors/ColorItemControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/Colors/ColorListControl.axaml" />
|
||||
<ResourceInclude Source="../Controls/Colors/ColorListGroupControl.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<TabControl>
|
||||
<TabItem Header="Light">
|
||||
<ScrollViewer>
|
||||
<ItemsControl ItemsSource="{Binding LightLists}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"></StackPanel>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="viewModels:ColorGroupViewModel">
|
||||
<controls:ColorListGroupControl GroupData="{Binding}"
|
||||
Margin="0, 0, 0, 10" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem Header="Dark">
|
||||
<ScrollViewer>
|
||||
<Border Background="Black">
|
||||
<ItemsControl ItemsSource="{Binding DarkLists}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Vertical"></StackPanel>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="viewModels:ColorGroupViewModel">
|
||||
<controls:ColorListGroupControl GroupData="{Binding}"
|
||||
Margin="0, 0, 0, 10" />
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</UserControl>
|
@ -0,0 +1,25 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Threading;
|
||||
using AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class PaletteShowCase : UserControl
|
||||
{
|
||||
public PaletteShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
PaletteDemoViewModel vm = new PaletteDemoViewModel();
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
vm.InitializeResources();
|
||||
});
|
||||
DataContext = vm;
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/PopoverShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/PopoverShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.PopoverShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class PopoverShowCase : UserControl
|
||||
{
|
||||
public PopoverShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ProgressBarShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Progress bar"
|
||||
Description="A standard progress bar.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:ProgressBar Value="30" Minimum="0" Maximum="100"/>
|
||||
<atom:ProgressBar Value="50" Minimum="0" Maximum="100"/>
|
||||
<atom:ProgressBar Value="70" Minimum="0" Maximum="100" Status="Exception"/>
|
||||
<atom:ProgressBar Value="100" Minimum="0" Maximum="100"/>
|
||||
<atom:ProgressBar Value="50" Minimum="0" Maximum="100" ShowProgressInfo="False"/>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ProgressBarShowCase : UserControl
|
||||
{
|
||||
public ProgressBarShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ProgressIndicatorShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ProgressIndicatorShowCase : UserControl
|
||||
{
|
||||
public ProgressIndicatorShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
183
Samples/AtomUI.Demo.Desktop/ShowCase/RadioButtonShowCase.axaml
Normal file
183
Samples/AtomUI.Demo.Desktop/ShowCase/RadioButtonShowCase.axaml
Normal file
@ -0,0 +1,183 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.RadioButtonShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCasePanel.Styles>
|
||||
<Style Selector="atom|RadioButton">
|
||||
<Setter Property="Margin" Value="0, 0, 5, 10"></Setter>
|
||||
</Style>
|
||||
</showcase:ShowCasePanel.Styles>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="The simplest use.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Horizontal">
|
||||
<atom:RadioButton>Radio</atom:RadioButton>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Disabled"
|
||||
Description="Disabled state of RadioButton.">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Vertical">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<atom:RadioButton x:Name="ToggleDisabledRadioUnChecked">Radio1</atom:RadioButton>
|
||||
<atom:RadioButton x:Name="ToggleDisabledRadioChecked" IsChecked="True">Radio2</atom:RadioButton>
|
||||
</StackPanel>
|
||||
<atom:Button ButtonType="Primary"
|
||||
x:Name="ToggleDisabledButton"
|
||||
Margin="0, 20, 0, 0"
|
||||
Command="{Binding $parent[showcase:RadioButtonShowCase].ToggleDisabledStatus}"
|
||||
CommandParameter="{Binding ElementName=ToggleDisabledButton}">
|
||||
toggle disabled
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Radio Group"
|
||||
Description="A group of radio components.">
|
||||
<WrapPanel Orientation="Horizontal">
|
||||
<atom:RadioButton>A</atom:RadioButton>
|
||||
<atom:RadioButton>B</atom:RadioButton>
|
||||
<atom:RadioButton>C</atom:RadioButton>
|
||||
<atom:RadioButton>D</atom:RadioButton>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Vertical Radio Group"
|
||||
Description="Vertical Radio Group.">
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Left">
|
||||
<atom:RadioButton>Option A</atom:RadioButton>
|
||||
<atom:RadioButton>Option B</atom:RadioButton>
|
||||
<atom:RadioButton>Option C</atom:RadioButton>
|
||||
<atom:RadioButton>Option D</atom:RadioButton>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Option Button"
|
||||
Description="OptionButton Group.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<atom:RadioButton IsChecked="True">Apple</atom:RadioButton>
|
||||
<atom:RadioButton>Pear</atom:RadioButton>
|
||||
<atom:RadioButton>Orange</atom:RadioButton>
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
|
||||
<atom:RadioButton IsChecked="True">Apple</atom:RadioButton>
|
||||
<atom:RadioButton>Pear</atom:RadioButton>
|
||||
<atom:RadioButton IsEnabled="False">Orange</atom:RadioButton>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Spacing="10">
|
||||
<atom:OptionButtonGroup ButtonStyle="Solid">
|
||||
<atom:OptionButton IsChecked="True">Apple</atom:OptionButton>
|
||||
<atom:OptionButton>Pear</atom:OptionButton>
|
||||
<atom:OptionButton>Orange</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
</StackPanel>
|
||||
<atom:OptionButtonGroup ButtonStyle="Outline">
|
||||
<atom:OptionButton>Apple</atom:OptionButton>
|
||||
<atom:OptionButton IsChecked="True">Pear</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Orange</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="option style"
|
||||
Description="The combination of option button style.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:OptionButtonGroup>
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton>Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
<atom:OptionButtonGroup>
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
|
||||
<atom:OptionButtonGroup>
|
||||
<atom:OptionButton IsChecked="True" IsEnabled="False">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Beijing</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Solid option button"
|
||||
Description="Solid option button style.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
|
||||
<atom:OptionButtonGroup ButtonStyle="Solid">
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton>Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
<atom:OptionButtonGroup ButtonStyle="Solid">
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
|
||||
<atom:OptionButtonGroup ButtonStyle="Solid">
|
||||
<atom:OptionButton IsChecked="True" IsEnabled="False">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Beijing</atom:OptionButton>
|
||||
<atom:OptionButton IsEnabled="False">Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Size type"
|
||||
Description="There are three sizes available: large, medium, and small. It can coordinate with input box.">
|
||||
<StackPanel Orientation="Vertical" Spacing="10">
|
||||
<atom:OptionButtonGroup SizeType="Large">
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton>Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
<atom:OptionButtonGroup SizeType="Middle">
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton>Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
|
||||
<atom:OptionButtonGroup SizeType="Small">
|
||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||
<atom:OptionButton>Shanghai</atom:OptionButton>
|
||||
<atom:OptionButton>Beijing</atom:OptionButton>
|
||||
<atom:OptionButton>Chengdu</atom:OptionButton>
|
||||
</atom:OptionButtonGroup>
|
||||
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,33 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class RadioButtonShowCase : UserControl
|
||||
{
|
||||
protected List<string> CheckRadios { get; set; }
|
||||
|
||||
public RadioButtonShowCase()
|
||||
{
|
||||
CheckRadios = new List<string>()
|
||||
{
|
||||
"ToggleDisabledRadioUnChecked",
|
||||
"ToggleDisabledRadioChecked"
|
||||
};
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static void ToggleDisabledStatus(object arg)
|
||||
{
|
||||
var btn = (arg as Button)!;
|
||||
var stackPanel = btn.Parent as StackPanel;
|
||||
var radioBtn1 = stackPanel?.FindControl<RadioButton>("ToggleDisabledRadioUnChecked");
|
||||
var radioBtn2 = stackPanel?.FindControl<RadioButton>("ToggleDisabledRadioChecked");
|
||||
if (radioBtn1 != null) {
|
||||
radioBtn1.IsEnabled = !radioBtn1.IsEnabled;
|
||||
}
|
||||
|
||||
if (radioBtn2 != null) {
|
||||
radioBtn2.IsEnabled = !radioBtn2.IsEnabled;
|
||||
}
|
||||
}
|
||||
}
|
146
Samples/AtomUI.Demo.Desktop/ShowCase/SegmentedShowCase.axaml
Normal file
146
Samples/AtomUI.Demo.Desktop/ShowCase/SegmentedShowCase.axaml
Normal file
@ -0,0 +1,146 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.SegmentedShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="The most basic usage.">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Vertical">
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>Daily</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Weekly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Monthly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Quarterly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Yearly</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Block Segmented"
|
||||
Description="block property will make the Segmented fit to its parent width.">
|
||||
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||
<atom:Segmented Expanding="True">
|
||||
<atom:SegmentedItem>123</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>456</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>longtext-longtext-longtext-longtext</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Disabled"
|
||||
Description="Disabled Segmented.">
|
||||
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical" Spacing="10">
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem IsEnabled="False">Map</atom:SegmentedItem>
|
||||
<atom:SegmentedItem IsEnabled="False">Transit</atom:SegmentedItem>
|
||||
<atom:SegmentedItem IsEnabled="False">Satellite</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>Daily</atom:SegmentedItem>
|
||||
<atom:SegmentedItem IsEnabled="False">Weekly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Monthly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem IsEnabled="False">Quarterly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Yearly</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Three sizes of Segmented"
|
||||
Description="There are three sizes of an Segmented: large (40px), default (32px) and small (24px).">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Vertical" Spacing="10">
|
||||
<atom:Segmented SizeType="Large">
|
||||
<atom:SegmentedItem>Daily</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Weekly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Monthly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Quarterly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Yearly</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>Daily</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Weekly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Monthly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Quarterly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Yearly</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
|
||||
<atom:Segmented SizeType="Small">
|
||||
<atom:SegmentedItem>Daily</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Weekly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Monthly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Quarterly</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>Yearly</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="With Icon only"
|
||||
Description="Set icon without label for Segmented Item.">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Vertical" Spacing="10">
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="BarsOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
</atom:SegmentedItem>
|
||||
<atom:SegmentedItem>
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="AppstoreOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="With Icon"
|
||||
Description="Set icon for Segmented Item.">
|
||||
<StackPanel HorizontalAlignment="Left" Orientation="Vertical" Spacing="10">
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="BarsOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
List
|
||||
</atom:SegmentedItem>
|
||||
<atom:SegmentedItem Text="Kanban">
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="AppstoreOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
</atom:SegmentedItem>
|
||||
</atom:Segmented>
|
||||
|
||||
<atom:Segmented>
|
||||
<atom:SegmentedItem>
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="BarsOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
Ava 牛逼
|
||||
</atom:SegmentedItem>
|
||||
<atom:SegmentedItem Text="群主牛逼">
|
||||
<atom:SegmentedItem.Icon>
|
||||
<atom:PathIcon Kind="WechatOutlined"></atom:PathIcon>
|
||||
</atom:SegmentedItem.Icon>
|
||||
</atom:SegmentedItem>
|
||||
|
||||
<atom:SegmentedItem Text="微软牛逼"
|
||||
Icon="{atom:IconProvider Kind=WindowsOutlined}">
|
||||
</atom:SegmentedItem>
|
||||
|
||||
</atom:Segmented>
|
||||
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class SegmentedShowCase : UserControl
|
||||
{
|
||||
public SegmentedShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/SeparatorShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/SeparatorShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.SeparatorShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class SeparatorShowCase : UserControl
|
||||
{
|
||||
public SeparatorShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/SliderShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/SliderShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.SliderShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
14
Samples/AtomUI.Demo.Desktop/ShowCase/SliderShowCase.axaml.cs
Normal file
14
Samples/AtomUI.Demo.Desktop/ShowCase/SliderShowCase.axaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class SliderShowCase : UserControl
|
||||
{
|
||||
public SliderShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.SpinIndicatorShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class SpinIndicatorShowCase : UserControl
|
||||
{
|
||||
public SpinIndicatorShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
86
Samples/AtomUI.Demo.Desktop/ShowCase/SwitchShowCase.axaml
Normal file
86
Samples/AtomUI.Demo.Desktop/ShowCase/SwitchShowCase.axaml
Normal file
@ -0,0 +1,86 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.SwitchShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="The most basic usage.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Horizontal">
|
||||
<atom:ToggleSwitch />
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Disabled"
|
||||
Description="Disabled state of Switch.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:ToggleSwitch x:Name="ToggleDisabledSwitch" />
|
||||
<atom:Button ButtonType="Primary"
|
||||
Command="{Binding $parent[showcase:SwitchShowCase].ToggleDisabledStatus}"
|
||||
CommandParameter="{Binding ElementName=ToggleDisabledSwitch}">
|
||||
toggle disabled
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Text and icon"
|
||||
Description="With text and icon.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:ToggleSwitch
|
||||
OnContent="On"
|
||||
OffContent="Off"
|
||||
IsChecked="True" />
|
||||
<atom:ToggleSwitch
|
||||
OnContent="开"
|
||||
OffContent="关" />
|
||||
<atom:ToggleSwitch>
|
||||
<atom:ToggleSwitch.OnContent>
|
||||
<atom:PathIcon Kind="TwitterOutlined"/>
|
||||
</atom:ToggleSwitch.OnContent>
|
||||
<atom:ToggleSwitch.OffContent>
|
||||
<atom:PathIcon Kind="WechatOutlined"/>
|
||||
</atom:ToggleSwitch.OffContent>
|
||||
</atom:ToggleSwitch>
|
||||
<atom:ToggleSwitch SizeType="Small">
|
||||
<atom:ToggleSwitch.OnContent>
|
||||
<atom:PathIcon Kind="CheckOutlined"/>
|
||||
</atom:ToggleSwitch.OnContent>
|
||||
<atom:ToggleSwitch.OffContent>
|
||||
<atom:PathIcon Kind="CloseOutlined"/>
|
||||
</atom:ToggleSwitch.OffContent>
|
||||
</atom:ToggleSwitch>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Two sizes"
|
||||
Description="size=Small represents a small sized switch.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:ToggleSwitch />
|
||||
<atom:ToggleSwitch SizeType="Small" />
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Loading"
|
||||
Description="Mark a pending state of switch.">
|
||||
<StackPanel HorizontalAlignment="Left" Spacing="10" Orientation="Vertical">
|
||||
<atom:ToggleSwitch IsLoading="True" IsChecked="true" x:Name="ToggleSwitchDefault" />
|
||||
<atom:ToggleSwitch SizeType="Small" IsLoading="True" x:Name="ToggleSwitchSmall" />
|
||||
<atom:Button ButtonType="Primary"
|
||||
x:Name="ToggleLoadingStatusBtn"
|
||||
Command="{Binding $parent[showcase:SwitchShowCase].ToggleLoadingStatus}"
|
||||
CommandParameter="{Binding ElementName=ToggleLoadingStatusBtn}">
|
||||
toggle loading
|
||||
</atom:Button>
|
||||
</StackPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
36
Samples/AtomUI.Demo.Desktop/ShowCase/SwitchShowCase.axaml.cs
Normal file
36
Samples/AtomUI.Demo.Desktop/ShowCase/SwitchShowCase.axaml.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class SwitchShowCase : UserControl
|
||||
{
|
||||
public SwitchShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static void ToggleDisabledStatus(object arg)
|
||||
{
|
||||
var switchBtn = (arg as ToggleSwitch)!;
|
||||
switchBtn.IsEnabled = !switchBtn.IsEnabled;
|
||||
}
|
||||
|
||||
public static void ToggleLoadingStatus(object arg)
|
||||
{
|
||||
var btn = (arg as Button)!;
|
||||
var stackPanel = btn.Parent as StackPanel;
|
||||
var toggleSwitchDefault = stackPanel?.Children[0] as ToggleSwitch;
|
||||
var toggleSwitchSmall = stackPanel?.Children[1] as ToggleSwitch;
|
||||
if (toggleSwitchDefault is not null) {
|
||||
toggleSwitchDefault.IsLoading = !toggleSwitchDefault.IsLoading;
|
||||
}
|
||||
|
||||
if (toggleSwitchSmall is not null) {
|
||||
toggleSwitchSmall.IsLoading = !toggleSwitchSmall.IsLoading;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TabControlShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TabControlShowCase : UserControl
|
||||
{
|
||||
public TabControlShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
185
Samples/AtomUI.Demo.Desktop/ShowCase/TagShowCase.axaml
Normal file
185
Samples/AtomUI.Demo.Desktop/ShowCase/TagShowCase.axaml
Normal file
@ -0,0 +1,185 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TagShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
<showcase:ShowCasePanel.Styles>
|
||||
<Style Selector="atom|Tag">
|
||||
<Setter Property="Margin" Value="5" />
|
||||
</Style>
|
||||
</showcase:ShowCasePanel.Styles>
|
||||
<showcase:ShowCaseItem
|
||||
Title="Basic"
|
||||
Description="Usage of basic Tag, and it could be closable and customize close button by set closeIcon property,will display default close button when closeIcon is setting to true. Closable Tag supports onClose events.">
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<atom:Tag>Tag 1</atom:Tag>
|
||||
<atom:Tag>Link</atom:Tag>
|
||||
<atom:Tag Closable="true">Prevent Default</atom:Tag>
|
||||
<atom:Tag Closable="True">
|
||||
<atom:Tag.CloseIcon>
|
||||
<atom:PathIcon Kind="CloseCircleOutlined " />
|
||||
</atom:Tag.CloseIcon>
|
||||
Tag 2
|
||||
</atom:Tag>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Colorful Tag"
|
||||
Description="We preset a series of colorful tag styles for use in different situations. You can also set it to a hex color string for custom color.">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock FontWeight="Bold" FontSize="14" Margin="0, 0, 0, 10">Presets</TextBlock>
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag TagColor="magenta">magenta</atom:Tag>
|
||||
<atom:Tag TagColor="red">red</atom:Tag>
|
||||
<atom:Tag TagColor="volcano">volcano</atom:Tag>
|
||||
<atom:Tag TagColor="orange">orange</atom:Tag>
|
||||
<atom:Tag TagColor="gold">gold</atom:Tag>
|
||||
<atom:Tag TagColor="lime">lime</atom:Tag>
|
||||
<atom:Tag TagColor="green">green</atom:Tag>
|
||||
<atom:Tag TagColor="cyan">cyan</atom:Tag>
|
||||
<atom:Tag TagColor="blue">blue</atom:Tag>
|
||||
<atom:Tag TagColor="geekblue">geekblue</atom:Tag>
|
||||
<atom:Tag TagColor="purple">purple</atom:Tag>
|
||||
</WrapPanel>
|
||||
|
||||
<TextBlock FontWeight="Bold" FontSize="14" Margin="0, 20, 0, 10">Custom</TextBlock>
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag TagColor="#f50">#f50</atom:Tag>
|
||||
<atom:Tag TagColor="#2db7f5" Closable="True">#2db7f5</atom:Tag>
|
||||
<atom:Tag TagColor="#87d068">#87d068</atom:Tag>
|
||||
<atom:Tag TagColor="#108ee9">#108ee9</atom:Tag>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Status Tag"
|
||||
Description="We preset five different colors, you can set color property such as success,processing,error,default and warning to indicate specific status.">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<TextBlock FontWeight="Bold" FontSize="14" Margin="0, 0, 0, 10">Without icon</TextBlock>
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag TagColor="success">success</atom:Tag>
|
||||
<atom:Tag TagColor="info">processing</atom:Tag>
|
||||
<atom:Tag TagColor="error">error</atom:Tag>
|
||||
<atom:Tag TagColor="warning">warning</atom:Tag>
|
||||
<atom:Tag TagColor="default">default</atom:Tag>
|
||||
</WrapPanel>
|
||||
|
||||
<TextBlock FontWeight="Bold" FontSize="14" Margin="0, 20, 0, 10">Custom</TextBlock>
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag TagColor="success">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="CheckCircleOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
success
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="info">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="SyncOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
processing
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="error">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="CloseCircleOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
error
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="warning">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="ExclamationCircleOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
warning
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="default">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="ClockCircleOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
default
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="default">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="MinusCircleOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
default
|
||||
</atom:Tag>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="Icon"
|
||||
Description="Tag components can contain an Icon. This is done by setting the icon property or placing an Icon component within the Tag.
|
||||
If you want specific control over the positioning and placement of the Icon, then that should be done by placing the Icon component within the Tag rather than using the icon property.">
|
||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||
<atom:Tag TagColor="#55acee">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="TwitterOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
Twitter
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="#cd201f">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="YoutubeOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
Youtube
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="#3b5999">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="FacebookOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
Facebook
|
||||
</atom:Tag>
|
||||
<atom:Tag TagColor="#55acee">
|
||||
<atom:Tag.Icon>
|
||||
<atom:PathIcon Kind="LinkedinOutlined" />
|
||||
</atom:Tag.Icon>
|
||||
Linkedin
|
||||
</atom:Tag>
|
||||
</WrapPanel>
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
<showcase:ShowCaseItem
|
||||
Title="borderless"
|
||||
Description="borderless">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag Bordered="False">Tag1</atom:Tag>
|
||||
<atom:Tag Bordered="False">Tag2</atom:Tag>
|
||||
<atom:Tag Bordered="False" Closable="True">Tag3</atom:Tag>
|
||||
<atom:Tag Bordered="False" Closable="True">Tag4</atom:Tag>
|
||||
</WrapPanel>
|
||||
|
||||
<Separator FontWeight="Bold" FontSize="14" Margin="0, 20, 0, 20"/>
|
||||
<WrapPanel HorizontalAlignment="Left">
|
||||
<atom:Tag TagColor="magenta" Bordered="False">magenta</atom:Tag>
|
||||
<atom:Tag TagColor="red" Bordered="False">red</atom:Tag>
|
||||
<atom:Tag TagColor="volcano" Bordered="False">volcano</atom:Tag>
|
||||
<atom:Tag TagColor="orange" Bordered="False">orange</atom:Tag>
|
||||
<atom:Tag TagColor="gold" Bordered="False">gold</atom:Tag>
|
||||
<atom:Tag TagColor="lime" Bordered="False">lime</atom:Tag>
|
||||
<atom:Tag TagColor="green" Bordered="False">green</atom:Tag>
|
||||
<atom:Tag TagColor="cyan" Bordered="False">cyan</atom:Tag>
|
||||
<atom:Tag TagColor="blue" Bordered="False">blue</atom:Tag>
|
||||
<atom:Tag TagColor="geekblue" Bordered="False">geekblue</atom:Tag>
|
||||
<atom:Tag TagColor="purple" Bordered="False">purple</atom:Tag>
|
||||
|
||||
<atom:Tag TagColor="success" Bordered="False">success</atom:Tag>
|
||||
<atom:Tag TagColor="info" Bordered="False">processing</atom:Tag>
|
||||
<atom:Tag TagColor="error" Bordered="False">error</atom:Tag>
|
||||
<atom:Tag TagColor="warning" Bordered="False">warning</atom:Tag>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
|
||||
</showcase:ShowCaseItem>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
14
Samples/AtomUI.Demo.Desktop/ShowCase/TagShowCase.axaml.cs
Normal file
14
Samples/AtomUI.Demo.Desktop/ShowCase/TagShowCase.axaml.cs
Normal file
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TagShowCase : UserControl
|
||||
{
|
||||
public TagShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/TimelineShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/TimelineShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TimelineShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TimelineShowCase : UserControl
|
||||
{
|
||||
public TimelineShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/TitleBarShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/TitleBarShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TitleBarShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TitleBarShowCase : UserControl
|
||||
{
|
||||
public TitleBarShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/ToolBarShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/ToolBarShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.ToolBarShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,13 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class ToolBarShowCase : UserControl
|
||||
{
|
||||
public ToolBarShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/TooltipShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/TooltipShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TooltipShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TooltipShowCase : UserControl
|
||||
{
|
||||
public TooltipShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
13
Samples/AtomUI.Demo.Desktop/ShowCase/TreeViewShowCase.axaml
Normal file
13
Samples/AtomUI.Demo.Desktop/ShowCase/TreeViewShowCase.axaml
Normal file
@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="AtomUI.Demo.Desktop.ShowCase.TreeViewShowCase"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:atom="https://atomui.net"
|
||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
||||
mc:Ignorable="d">
|
||||
<showcase:ShowCasePanel>
|
||||
|
||||
</showcase:ShowCasePanel>
|
||||
</UserControl>
|
@ -0,0 +1,14 @@
|
||||
using Avalonia.Controls;
|
||||
using Button = AtomUI.Controls.Button;
|
||||
using ToggleSwitch = AtomUI.Controls.ToggleSwitch;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||
|
||||
public partial class TreeViewShowCase : UserControl
|
||||
{
|
||||
public TreeViewShowCase()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
}
|
44
Samples/AtomUI.Demo.Desktop/Themes/TabMenu.axaml
Normal file
44
Samples/AtomUI.Demo.Desktop/Themes/TabMenu.axaml
Normal file
@ -0,0 +1,44 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="NavigationTab" TargetType="TabControl">
|
||||
<Setter Property="TabControl.Template">
|
||||
<!-- -->
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Border
|
||||
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<DockPanel>
|
||||
<ScrollViewer DockPanel.Dock="Left" VerticalScrollBarVisibility="Auto">
|
||||
<Panel DockPanel.Dock="{TemplateBinding TabStripPlacement}">
|
||||
<ItemsPresenter Name="PART_ItemsPresenter">
|
||||
<ItemsPresenter.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsPresenter.ItemsPanel>
|
||||
</ItemsPresenter>
|
||||
<Border Name="PART_BorderSeparator" Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||
</Panel>
|
||||
</ScrollViewer>
|
||||
<ContentPresenter
|
||||
Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Content="{TemplateBinding SelectedContent}"
|
||||
ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
|
||||
</DockPanel>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^[TabStripPlacement=Left] /template/ Border#PART_BorderSeparator">
|
||||
<Setter Property="Width" Value="1" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
27
Samples/AtomUI.Demo.Desktop/Themes/ToggleButton.axaml
Normal file
27
Samples/AtomUI.Demo.Desktop/Themes/ToggleButton.axaml
Normal file
@ -0,0 +1,27 @@
|
||||
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- Add Resources Here -->
|
||||
<ControlTheme x:Key="SplitViewToggleButton" TargetType="ToggleButton">
|
||||
<Setter Property="ToggleButton.Template">
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border
|
||||
Name="Background"
|
||||
Padding="8"
|
||||
Background="{TemplateBinding Background}"
|
||||
CornerRadius="3">
|
||||
<PathIcon
|
||||
Name="Icon"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Data="M5 2H19C20.6569 2 22 3.34315 22 5V19C22 20.6569 20.6569 22 19 22H5C3.34315 22 2 20.6569 2 19V5C2 3.34315 3.34315 2 5 2ZM6 4C5.44772 4 5 4.44772 5 5V19C5 19.5523 5.44772 20 6 20H9C9.55229 20 10 19.5523 10 19V5C10 4.44772 9.55229 4 9 4H6Z"
|
||||
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPointeroverBackground}" />
|
||||
</Style>
|
||||
<Style Selector="^:pressed">
|
||||
<Setter Property="Background" Value="{DynamicResource ButtonDefaultPressedBackground}" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
</ResourceDictionary>
|
165
Samples/AtomUI.Demo.Desktop/ViewModels/CheckBoxShowCaseModel.cs
Normal file
165
Samples/AtomUI.Demo.Desktop/ViewModels/CheckBoxShowCaseModel.cs
Normal file
@ -0,0 +1,165 @@
|
||||
using AtomUI.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
public class CheckBoxShowCaseModel : ObservableObject
|
||||
{
|
||||
public bool? _controlledCheckBoxCheckedStatus;
|
||||
public bool? ControlledCheckBoxCheckedStatus
|
||||
{
|
||||
get => _controlledCheckBoxCheckedStatus;
|
||||
set => SetProperty(ref _controlledCheckBoxCheckedStatus, value);
|
||||
}
|
||||
|
||||
public bool _controlledCheckBoxEnabledStatus;
|
||||
public bool ControlledCheckBoxEnabledStatus
|
||||
{
|
||||
get => _controlledCheckBoxEnabledStatus;
|
||||
set => SetProperty(ref _controlledCheckBoxEnabledStatus, value);
|
||||
}
|
||||
|
||||
private string? _checkStatusBtnText;
|
||||
public string? CheckStatusBtnText
|
||||
{
|
||||
get => _checkStatusBtnText;
|
||||
set => SetProperty(ref _checkStatusBtnText, value);
|
||||
}
|
||||
|
||||
private string? _enableStatusBtnText;
|
||||
public string? EnableStatusBtnText
|
||||
{
|
||||
get => _enableStatusBtnText;
|
||||
set => SetProperty(ref _enableStatusBtnText, value);
|
||||
}
|
||||
|
||||
private string? _controlledCheckBoxText;
|
||||
public string? ControlledCheckBoxText
|
||||
{
|
||||
get => _controlledCheckBoxText;
|
||||
set => SetProperty(ref _controlledCheckBoxText, value);
|
||||
}
|
||||
|
||||
// CheckAll 例子
|
||||
private bool? _checkedAllStatus;
|
||||
public bool? CheckedAllStatus
|
||||
{
|
||||
get => _checkedAllStatus;
|
||||
set => SetProperty(ref _checkedAllStatus, value);
|
||||
}
|
||||
|
||||
private bool _appleCheckedStatus;
|
||||
public bool AppleCheckedStatus
|
||||
{
|
||||
get => _appleCheckedStatus;
|
||||
set => SetProperty(ref _appleCheckedStatus, value);
|
||||
}
|
||||
|
||||
private bool _pearCheckedStatus;
|
||||
public bool PearCheckedStatus
|
||||
{
|
||||
get => _pearCheckedStatus;
|
||||
set => SetProperty(ref _pearCheckedStatus, value);
|
||||
}
|
||||
|
||||
private bool _orangeCheckedStatus;
|
||||
public bool OrangeCheckedStatus
|
||||
{
|
||||
get => _orangeCheckedStatus;
|
||||
set => SetProperty(ref _orangeCheckedStatus, value);
|
||||
}
|
||||
|
||||
public CheckBoxShowCaseModel()
|
||||
{
|
||||
CheckStatusBtnText = "UnCheck";
|
||||
EnableStatusBtnText = "Disable";
|
||||
ControlledCheckBoxCheckedStatus = true;
|
||||
ControlledCheckBoxEnabledStatus = true;
|
||||
SetupControlledCheckBoxText();
|
||||
|
||||
AppleCheckedStatus = false;
|
||||
PearCheckedStatus = true;
|
||||
OrangeCheckedStatus = true;
|
||||
CheckedAllStatus = null;
|
||||
}
|
||||
|
||||
public void CheckStatusHandler(object arg)
|
||||
{
|
||||
ControlledCheckBoxCheckedStatus = !ControlledCheckBoxCheckedStatus;
|
||||
SetupCheckBtnText();
|
||||
SetupControlledCheckBoxText();
|
||||
}
|
||||
|
||||
public void EnableStatusHandler(object arg)
|
||||
{
|
||||
ControlledCheckBoxEnabledStatus = !ControlledCheckBoxEnabledStatus;
|
||||
SetupEnabledBtnText();
|
||||
SetupControlledCheckBoxText();
|
||||
}
|
||||
|
||||
public void CheckBoxHandler(object arg)
|
||||
{
|
||||
SetupCheckBtnText();
|
||||
SetupControlledCheckBoxText();
|
||||
}
|
||||
|
||||
private void SetupCheckBtnText()
|
||||
{
|
||||
if (ControlledCheckBoxCheckedStatus.HasValue) {
|
||||
if (ControlledCheckBoxCheckedStatus.Value) {
|
||||
CheckStatusBtnText = "UnCheck";
|
||||
} else {
|
||||
CheckStatusBtnText = "Check";
|
||||
}
|
||||
} else {
|
||||
CheckStatusBtnText = "Check";
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupEnabledBtnText()
|
||||
{
|
||||
if (ControlledCheckBoxEnabledStatus) {
|
||||
EnableStatusBtnText = "Disable";
|
||||
} else {
|
||||
EnableStatusBtnText = "Enable";
|
||||
}
|
||||
}
|
||||
|
||||
private void SetupControlledCheckBoxText()
|
||||
{
|
||||
var checkedText = "UnChecked";
|
||||
if (ControlledCheckBoxCheckedStatus.HasValue && ControlledCheckBoxCheckedStatus.Value) {
|
||||
checkedText = "Checked";
|
||||
}
|
||||
|
||||
var enabledText = "Disabled";
|
||||
if (ControlledCheckBoxEnabledStatus) {
|
||||
enabledText = "Enabled";
|
||||
}
|
||||
ControlledCheckBoxText = $"{checkedText}-{enabledText}";
|
||||
}
|
||||
|
||||
public void CheckedAllStatusHandler()
|
||||
{
|
||||
if (!CheckedAllStatus.HasValue || !CheckedAllStatus.Value) {
|
||||
AppleCheckedStatus = false;
|
||||
PearCheckedStatus = false;
|
||||
OrangeCheckedStatus = false;
|
||||
} else {
|
||||
AppleCheckedStatus = true;
|
||||
PearCheckedStatus = true;
|
||||
OrangeCheckedStatus = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void CheckedItemStatusHandler(object arg)
|
||||
{
|
||||
if (OrangeCheckedStatus && PearCheckedStatus && AppleCheckedStatus) {
|
||||
CheckedAllStatus = true;
|
||||
} else if (!OrangeCheckedStatus && !PearCheckedStatus && !AppleCheckedStatus) {
|
||||
CheckedAllStatus = false;
|
||||
} else {
|
||||
CheckedAllStatus = null;
|
||||
}
|
||||
}
|
||||
}
|
162
Samples/AtomUI.Demo.Desktop/ViewModels/DataGridDemoViewModel.cs
Normal file
162
Samples/AtomUI.Demo.Desktop/ViewModels/DataGridDemoViewModel.cs
Normal file
@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using Avalonia.Collections;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
public class DataGridDemoViewModel: ObservableObject
|
||||
{
|
||||
public ObservableCollection<Song> GridData1 { get; set; }
|
||||
|
||||
public DataGridCollectionView GridData2 { get; set; }
|
||||
|
||||
public ObservableCollection<SongViewModel> GridData3 { get; set; }
|
||||
|
||||
public RelayCommand AddCommand { get; set; }
|
||||
|
||||
public DataGridDemoViewModel()
|
||||
{
|
||||
GridData1 = new ObservableCollection<Song>(Song.Songs);
|
||||
GridData2 = new DataGridCollectionView(Song.Songs);
|
||||
GridData2.GroupDescriptions.Add(new DataGridPathGroupDescription("Album"));
|
||||
GridData3 = new ObservableCollection<SongViewModel>(Song.Songs.Take(10).Select(a=>new SongViewModel()
|
||||
{
|
||||
Title = a.Title,
|
||||
Artist = a.Artist,
|
||||
Album = a.Album,
|
||||
CountOfComment = a.CountOfComment,
|
||||
IsSelected = false
|
||||
}));
|
||||
AddCommand = new RelayCommand(Add);
|
||||
}
|
||||
|
||||
private void Add()
|
||||
{
|
||||
GridData3.Add(new SongViewModel());
|
||||
}
|
||||
}
|
||||
|
||||
public class Song
|
||||
{
|
||||
public string? Title { get; set; }
|
||||
public string? Artist { get; set; }
|
||||
public TimeSpan? Duration { get; set; }
|
||||
public string? Album { get; set; }
|
||||
public int CountOfComment { get; set; }
|
||||
public string Url { get; set; }
|
||||
|
||||
public Song(string title, string artist, int m, int s, string album, int countOfComment, int netEaseId)
|
||||
{
|
||||
Title = title;
|
||||
Artist = artist;
|
||||
Duration = new TimeSpan(0, m, s);
|
||||
Album = album;
|
||||
CountOfComment = countOfComment;
|
||||
Url = $"https://music.163.com/song?id={netEaseId}";
|
||||
|
||||
}
|
||||
|
||||
public static List<Song> Songs { get; set; } = new List<Song>()
|
||||
{
|
||||
new("好肚有肚(feat.李玲玉)", "熊猫堂ProducePandas", 2, 50, "A.S.I.A", 730, 1487039339),
|
||||
new("荒诞秀", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 639, 1487037601),
|
||||
new("长大", "熊猫堂ProducePandas", 4, 6, "A.S.I.A", 1114, 1487037690),
|
||||
new("招财猫(feat.纪粹希(G-Tracy))", "熊猫堂ProducePandas", 3, 37, "A.S.I.A", 361, 1487039632),
|
||||
new("千转", "熊猫堂ProducePandas", 4, 0, "A.S.I.A", 1115, 1477312398),
|
||||
new("辣辣辣", "熊猫堂ProducePandas", 3, 24, "A.S.I.A", 1873, 1465043716),
|
||||
new("碎碎念", "熊猫堂ProducePandas", 3, 25, "A.S.I.A", 676, 1474142064),
|
||||
new("盘他", "熊猫堂ProducePandas", 2, 16, "A.S.I.A", 365, 1481652786),
|
||||
new("Na Na Na", "熊猫堂ProducePandas", 3, 26, "A.S.I.A", 312, 1469022662),
|
||||
new("Indigo", "熊猫堂ProducePandas", 3, 15, "A.S.I.A", 137, 1487039517),
|
||||
new("饕餮人间", "熊猫堂ProducePandas", 3, 20, "饕餮人间", 1295, 1499584605),
|
||||
new("七步咙咚呛", "熊猫堂ProducePandas", 3, 10, "七步咙咚呛", 175, 1809095152),
|
||||
new("大惊小怪", "熊猫堂ProducePandas", 3, 32, "大惊小怪", 10420, 1847477425),
|
||||
new("工具人", "熊猫堂ProducePandas", 2, 46, "大惊小怪", 1135, 1847476499),
|
||||
new("以梦为马", "熊猫堂ProducePandas", 4, 19, "大惊小怪", 18361, 1836034373),
|
||||
new("以梦为马(Piano Version)", "熊猫堂ProducePandas", 3, 4, "大惊小怪", 570, 1847477423),
|
||||
new("The ONE", "熊猫堂ProducePandas", 2, 58, "The ONE", 1508, 1864329424),
|
||||
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "The ONE", 385, 1864329429),
|
||||
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 19, "以梦为马 (壮志骄阳版)", 161, 1865138896),
|
||||
new("New Horse", "熊猫堂ProducePandas", 2, 30, "emo了", 643, 1887021307),
|
||||
new("不例外", "熊猫堂ProducePandas", 3, 31, "emo了", 1818, 1887022665),
|
||||
new("满意", "熊猫堂ProducePandas", 4, 32, "emo了", 1081, 1882433472),
|
||||
new("就算与全世界为敌也要跟你在一起", "熊猫堂ProducePandas", 3, 32, "emo了", 2119, 1881759960),
|
||||
new("The ONE", "熊猫堂ProducePandas", 2, 58, "emo了", 67, 1887022648),
|
||||
new("口香糖", "熊猫堂ProducePandas", 3, 10, "emo了", 2181, 1885502254),
|
||||
new("Suuuuuuper Mario", "熊猫堂ProducePandas", 3, 32, "emo了", 1010, 1887021318),
|
||||
new("饕餮人间", "熊猫堂ProducePandas", 3, 22, "emo了", 109, 1887021320),
|
||||
new("以梦为马 (壮志骄阳版)", "熊猫堂ProducePandas", 4, 21, "emo了", 34, 1887022666),
|
||||
new("The ONE(日文版)", "熊猫堂ProducePandas", 2, 57, "emo了", 27, 1887022646),
|
||||
new("满意(DJheap九天版)", "熊猫堂ProducePandas", 4, 31, "emo了", 31, 1901605941),
|
||||
new("一眼万年", "熊猫堂ProducePandas", 3, 54, "一眼万年", 20, 1922599361),
|
||||
new("冲刺", "熊猫堂ProducePandas", 3, 49, "冲刺吧", 1006, 1932878194),
|
||||
new("滴答滴", "熊猫堂ProducePandas", 2, 30, "爱的赏味期限", 86, 1957515790),
|
||||
new("热带季风", "熊猫堂ProducePandas", 2, 45, "爱的赏味期限", 212, 1957514964),
|
||||
new("渣", "熊猫堂ProducePandas", 3, 28, "爱的赏味期限", 22, 1957514965),
|
||||
new("独特", "熊猫堂ProducePandas", 3, 33, "爱的赏味期限", 62, 1957514966),
|
||||
new("雨后", "熊猫堂ProducePandas", 4, 15, "爱的赏味期限", 23, 1957514967),
|
||||
new("然后然后", "熊猫堂ProducePandas", 3, 50, "爱的赏味期限", 108, 1957514968),
|
||||
new("丢", "熊猫堂ProducePandas", 3, 26, "爱的赏味期限", 30, 1957515792),
|
||||
new("热带疾风(FACEVOID桃心连哥 Remix)", "熊猫堂ProducePandas", 3, 23, "爱的赏味期限", 55, 1957515793),
|
||||
new("COSMIC ANTHEM -Japanese Ver.-", "熊猫堂ProducePandas", 3, 11, "COSMIC ANTHEM / 手紙", 0, 1977171493),
|
||||
new("手紙 (「長大-You Raise Me Up-」-Japanese Ver.-)", "熊猫堂ProducePandas", 4, 11, "COSMIC ANTHEM / 手紙", 0,
|
||||
1977171494),
|
||||
new("COSMIC ANTHEM -Chinese Ver.-", "熊猫堂ProducePandas", 3, 31, "COSMIC ANTHEM / 手紙", 0, 1977172202),
|
||||
new("世界晚安", "熊猫堂ProducePandas", 2, 59, "世界晚安", 652, 1985063377),
|
||||
new("世界晚安(泰文版)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 134, 1987842504),
|
||||
new("世界晚安(钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 76, 1990475933),
|
||||
new("世界晚安(泰文钢琴版)", "熊猫堂ProducePandas", 3, 2, "世界晚安", 29, 1990475934),
|
||||
new("世界晚安(DJ沈念版)", "熊猫堂ProducePandas", 3, 9, "世界晚安", 34, 2014263184),
|
||||
new("世界晚安(钢琴配乐)", "熊猫堂ProducePandas", 2, 59, "世界晚安", 11, 2014263185),
|
||||
new("明年也要好好长大", "熊猫堂ProducePandas", 3, 12, "明年也要好好长大", 0, 2010515162),
|
||||
new("320万年前(DJ沈念版)", "熊猫堂ProducePandas", 3, 21, "320万年前", 8, 2055888636),
|
||||
new("320万年前", "熊猫堂ProducePandas", 3, 7, "W.O.R.L.D.", 329, 2049770469),
|
||||
new("隐德来希", "熊猫堂ProducePandas", 3, 3, "W.O.R.L.D.", 594, 2061317924),
|
||||
new("孔明", "熊猫堂ProducePandas", 3, 59, "W.O.R.L.D.", 91, 2063175274),
|
||||
new("锦鲤卟噜噜", "熊猫堂ProducePandas", 3, 5, "W.O.R.L.D.", 67, 2059208262),
|
||||
new("指鹿为马", "熊猫堂ProducePandas", 3, 12, "W.O.R.L.D.", 74, 2063175272),
|
||||
new("热带季风Remix", "熊猫堂ProducePandas", 3, 22, "W.O.R.L.D.", 23, 2063173319),
|
||||
new("加州梦境", "熊猫堂ProducePandas", 2, 56, "W.O.R.L.D.", 1662, 2063173324),
|
||||
new("渐近自由", "熊猫堂ProducePandas", 4, 19, "W.O.R.L.D.", 124, 2063173321),
|
||||
new("世界所有的烂漫", "熊猫堂ProducePandas", 3, 30, "W.O.R.L.D.", 335, 2053388775),
|
||||
};
|
||||
}
|
||||
|
||||
public class SongViewModel: ObservableObject
|
||||
{
|
||||
private string? _title;
|
||||
private string? _artist;
|
||||
private string? _album;
|
||||
private int _countOfComment;
|
||||
private bool? _isSelected;
|
||||
public string? Title
|
||||
{
|
||||
get => _title;
|
||||
set => SetProperty(ref _title, value);
|
||||
}
|
||||
public string? Artist
|
||||
{
|
||||
get => _artist;
|
||||
set => SetProperty(ref _artist, value);
|
||||
}
|
||||
public string? Album
|
||||
{
|
||||
get => _album;
|
||||
set => SetProperty(ref _album, value);
|
||||
}
|
||||
public int CountOfComment
|
||||
{
|
||||
get => _countOfComment;
|
||||
set => SetProperty(ref _countOfComment, value);
|
||||
}
|
||||
public bool? IsSelected
|
||||
{
|
||||
get => _isSelected;
|
||||
set => SetProperty(ref _isSelected, value);
|
||||
}
|
||||
|
||||
}
|
234
Samples/AtomUI.Demo.Desktop/ViewModels/PaletteDemoViewModel.cs
Normal file
234
Samples/AtomUI.Demo.Desktop/ViewModels/PaletteDemoViewModel.cs
Normal file
@ -0,0 +1,234 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using AtomUI.ColorSystem;
|
||||
using Avalonia.Media;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Messaging;
|
||||
using SolidColorBrush = Avalonia.Media.SolidColorBrush;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
public class PaletteMetaItem
|
||||
{
|
||||
public string Title;
|
||||
public string Desc;
|
||||
public PresetPrimaryColor PresetPrimaryColor;
|
||||
|
||||
public PaletteMetaItem(string title, string desc, PresetPrimaryColor presetPrimaryColor)
|
||||
{
|
||||
Title = title;
|
||||
Desc = desc;
|
||||
PresetPrimaryColor = presetPrimaryColor;
|
||||
}
|
||||
}
|
||||
|
||||
public class PaletteDemoViewModel : ObservableObject
|
||||
{
|
||||
private readonly PaletteMetaItem[] _presetPaletteInfos =
|
||||
{
|
||||
new PaletteMetaItem("Dust Red / 薄暮", "斗志、奔放", PresetPrimaryColor.Red),
|
||||
new PaletteMetaItem("Volcano / 火山", "醒目、澎湃", PresetPrimaryColor.Volcano),
|
||||
new PaletteMetaItem("Sunset Orange / 日暮", "温暖、欢快", PresetPrimaryColor.Orange),
|
||||
new PaletteMetaItem("Calendula Gold / 金盏花", "活力、积极", PresetPrimaryColor.Gold),
|
||||
new PaletteMetaItem("Sunrise Yellow / 日出", "出生、阳光", PresetPrimaryColor.Yellow),
|
||||
new PaletteMetaItem("Lime / 青柠", "自然、生机", PresetPrimaryColor.Lime),
|
||||
new PaletteMetaItem("Polar Green / 极光绿", "健康、创新", PresetPrimaryColor.Green),
|
||||
new PaletteMetaItem("Cyan / 明青", "希望、坚强", PresetPrimaryColor.Cyan),
|
||||
new PaletteMetaItem("Daybreak Blue / 拂晓蓝", "包容、科技、普惠", PresetPrimaryColor.Blue),
|
||||
new PaletteMetaItem("Geek Blue / 极客蓝", "探索、钻研", PresetPrimaryColor.GeekBlue),
|
||||
new PaletteMetaItem("Golden Purple / 酱紫", "优雅、浪漫", PresetPrimaryColor.Purple),
|
||||
new PaletteMetaItem("Magenta / 法式洋红", "明快、感性", PresetPrimaryColor.Magenta),
|
||||
};
|
||||
|
||||
private ColorItemViewModel _selectedColor = null!;
|
||||
|
||||
public ColorItemViewModel SelectedColor
|
||||
{
|
||||
get => _selectedColor;
|
||||
set => SetProperty(ref _selectedColor, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<ColorGroupViewModel>? _lightLists;
|
||||
|
||||
public ObservableCollection<ColorGroupViewModel>? LightLists
|
||||
{
|
||||
get => _lightLists;
|
||||
set => SetProperty(ref _lightLists, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<ColorGroupViewModel>? _darkLists;
|
||||
|
||||
public ObservableCollection<ColorGroupViewModel>? DarkLists
|
||||
{
|
||||
get => _darkLists;
|
||||
set => SetProperty(ref _darkLists, value);
|
||||
}
|
||||
|
||||
public PaletteDemoViewModel()
|
||||
{
|
||||
WeakReferenceMessenger.Default.Register<PaletteDemoViewModel, ColorItemViewModel>(this, OnClickColorItem);
|
||||
}
|
||||
|
||||
public void InitializeResources()
|
||||
{
|
||||
InitializePalette();
|
||||
}
|
||||
|
||||
private void InitializePalette()
|
||||
{
|
||||
LightLists = new ObservableCollection<ColorGroupViewModel>();
|
||||
var cycleColorList = new ObservableCollection<ColorListViewModel>();
|
||||
int cycleCount = 0;
|
||||
for (int i = 0; i < _presetPaletteInfos.Length; ++i) {
|
||||
var metaInfo = _presetPaletteInfos[i];
|
||||
ColorListViewModel colorListViewModel = new ColorListViewModel();
|
||||
colorListViewModel.Title = metaInfo.Title;
|
||||
colorListViewModel.Desc = metaInfo.Desc;
|
||||
var paletteInfo = PresetPalettes.GetPresetPalette(metaInfo.PresetPrimaryColor);
|
||||
var colorItemViewModels = new ObservableCollection<ColorItemViewModel>();
|
||||
var presetColorName = metaInfo.PresetPrimaryColor.Name();
|
||||
|
||||
for (int j = 0; j < paletteInfo.ColorSequence.Count; j++) {
|
||||
var color = paletteInfo.ColorSequence[j];
|
||||
var colorItem = new ColorItemViewModel($"{presetColorName}-{j + 1}",
|
||||
new SolidColorBrush(color),
|
||||
true,
|
||||
j);
|
||||
colorItemViewModels.Add(colorItem);
|
||||
}
|
||||
|
||||
colorListViewModel.Colors = colorItemViewModels;
|
||||
cycleColorList.Add(colorListViewModel);
|
||||
++cycleCount;
|
||||
|
||||
if (cycleCount == 3) {
|
||||
var colorGroupModel = new ColorGroupViewModel();
|
||||
colorGroupModel.ColorList = cycleColorList;
|
||||
LightLists.Add(colorGroupModel);
|
||||
cycleColorList = new ObservableCollection<ColorListViewModel>();
|
||||
cycleCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
DarkLists = new ObservableCollection<ColorGroupViewModel>();
|
||||
|
||||
for (int i = 0; i < _presetPaletteInfos.Length; ++i) {
|
||||
var metaInfo = _presetPaletteInfos[i];
|
||||
ColorListViewModel colorListViewModel = new ColorListViewModel();
|
||||
colorListViewModel.Title = metaInfo.Title;
|
||||
colorListViewModel.Desc = metaInfo.Desc;
|
||||
var paletteInfo = PresetPalettes.GetPresetPalette(metaInfo.PresetPrimaryColor, true);
|
||||
var colorItemViewModels = new ObservableCollection<ColorItemViewModel>();
|
||||
var presetColorName = metaInfo.PresetPrimaryColor.Name();
|
||||
|
||||
for (int j = 0; j < paletteInfo.ColorSequence.Count; j++) {
|
||||
var color = paletteInfo.ColorSequence[j];
|
||||
var colorItem = new ColorItemViewModel($"{presetColorName}-{j + 1}",
|
||||
new SolidColorBrush(color),
|
||||
false,
|
||||
j);
|
||||
colorItemViewModels.Add(colorItem);
|
||||
}
|
||||
|
||||
colorListViewModel.Colors = colorItemViewModels;
|
||||
cycleColorList.Add(colorListViewModel);
|
||||
++cycleCount;
|
||||
|
||||
if (cycleCount == 3) {
|
||||
var colorGroupModel = new ColorGroupViewModel();
|
||||
colorGroupModel.ColorList = cycleColorList;
|
||||
DarkLists.Add(colorGroupModel);
|
||||
cycleColorList = new ObservableCollection<ColorListViewModel>();
|
||||
cycleCount = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnClickColorItem(PaletteDemoViewModel vm, ColorItemViewModel item)
|
||||
{
|
||||
SelectedColor = item;
|
||||
}
|
||||
}
|
||||
|
||||
public class ColorGroupViewModel : ObservableObject
|
||||
{
|
||||
private ObservableCollection<ColorListViewModel>? _colorList;
|
||||
|
||||
public ObservableCollection<ColorListViewModel>? ColorList
|
||||
{
|
||||
get => _colorList;
|
||||
set => SetProperty(ref _colorList, value);
|
||||
}
|
||||
}
|
||||
|
||||
public class ColorListViewModel : ObservableObject
|
||||
{
|
||||
private ObservableCollection<ColorItemViewModel>? _colors;
|
||||
|
||||
public ObservableCollection<ColorItemViewModel>? Colors
|
||||
{
|
||||
get => _colors;
|
||||
set => SetProperty(ref _colors, value);
|
||||
}
|
||||
|
||||
private string? _title;
|
||||
|
||||
public string? Title
|
||||
{
|
||||
get => _title;
|
||||
set => SetProperty(ref _title, value);
|
||||
}
|
||||
|
||||
private string? _desc;
|
||||
public string? Desc
|
||||
{
|
||||
get => _desc;
|
||||
set => SetProperty(ref _desc, value);
|
||||
}
|
||||
}
|
||||
|
||||
public class ColorItemViewModel : ObservableObject
|
||||
{
|
||||
private IBrush _brush = null!;
|
||||
|
||||
public IBrush Brush
|
||||
{
|
||||
get => _brush;
|
||||
set => SetProperty(ref _brush, value);
|
||||
}
|
||||
|
||||
private IBrush _textBrush = null!;
|
||||
|
||||
public IBrush TextBrush
|
||||
{
|
||||
get => _textBrush;
|
||||
set => SetProperty(ref _textBrush, value);
|
||||
}
|
||||
|
||||
private string _colorDisplayName = null!;
|
||||
|
||||
public string ColorDisplayName
|
||||
{
|
||||
get => _colorDisplayName;
|
||||
set => SetProperty(ref _colorDisplayName, value);
|
||||
}
|
||||
|
||||
private string _hex = null!;
|
||||
|
||||
public string Hex
|
||||
{
|
||||
get => _hex;
|
||||
set => SetProperty(ref _hex, value);
|
||||
}
|
||||
|
||||
public ColorItemViewModel(string colorDisplayName, ISolidColorBrush brush, bool light, int index)
|
||||
{
|
||||
ColorDisplayName = colorDisplayName;
|
||||
Brush = brush;
|
||||
Hex = brush.ToString()!.ToUpperInvariant();
|
||||
if ((light && index < 5) || (!light && index >= 5)) {
|
||||
TextBrush = Brushes.Black;
|
||||
} else {
|
||||
TextBrush = Brushes.White;
|
||||
}
|
||||
}
|
||||
}
|
66
Samples/AtomUI.Demo.Desktop/ViewModels/PathIconModel.cs
Normal file
66
Samples/AtomUI.Demo.Desktop/ViewModels/PathIconModel.cs
Normal file
@ -0,0 +1,66 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using AtomUI.Icon;
|
||||
using AtomUI.Icon.AntDesign;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
public class IconInfoItemModel : ObservableObject
|
||||
{
|
||||
private string _iconName = null!;
|
||||
|
||||
public string IconName
|
||||
{
|
||||
get => _iconName;
|
||||
set => SetProperty(ref _iconName, value);
|
||||
}
|
||||
|
||||
private string _iconKind = null!;
|
||||
|
||||
public string IconKind
|
||||
{
|
||||
get => _iconKind;
|
||||
set => SetProperty(ref _iconKind, value);
|
||||
}
|
||||
|
||||
public IconInfoItemModel(string iconName, string iconKind)
|
||||
{
|
||||
IconName = iconName;
|
||||
IconKind = iconKind;
|
||||
}
|
||||
}
|
||||
|
||||
public class IconGalleryModel : ObservableObject
|
||||
{
|
||||
private IconThemeType? _iconThemeType;
|
||||
|
||||
private ObservableCollection<IconInfoItemModel>? _iconInfos;
|
||||
public ObservableCollection<IconInfoItemModel>? IconInfos
|
||||
{
|
||||
get => _iconInfos;
|
||||
set => SetProperty(ref _iconInfos, value);
|
||||
}
|
||||
|
||||
public IconGalleryModel(IconThemeType? iconThemeType = null)
|
||||
{
|
||||
_iconThemeType = iconThemeType;
|
||||
if (_iconThemeType.HasValue) {
|
||||
LoadThemeIcons(_iconThemeType.Value);
|
||||
}
|
||||
}
|
||||
|
||||
public void LoadThemeIcons(IconThemeType iconThemeType)
|
||||
{
|
||||
var iconPackage = IconManager.Current.GetIconProvider<AntDesignIconPackage>();
|
||||
if (iconPackage is null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IconInfos = new ObservableCollection<IconInfoItemModel>();
|
||||
var iconInfos = iconPackage.GetIconInfos(iconThemeType);
|
||||
foreach (var iconInfo in iconInfos) {
|
||||
var iconInfoModel = new IconInfoItemModel(iconInfo.Name, iconInfo.Name);
|
||||
IconInfos.Add(iconInfoModel);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.ViewModels;
|
||||
|
||||
public class TabControlDemoViewModel: ObservableObject
|
||||
{
|
||||
public ObservableCollection<string> Items { get; set; }
|
||||
|
||||
public TabControlDemoViewModel()
|
||||
{
|
||||
Items = new ObservableCollection<string>(Enumerable.Range(1, 200).Select(a => "Tab " + a));
|
||||
}
|
||||
}
|
144
Samples/AtomUI.Demo.Desktop/Views/MainView.axaml
Normal file
144
Samples/AtomUI.Demo.Desktop/Views/MainView.axaml
Normal file
@ -0,0 +1,144 @@
|
||||
<UserControl
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d"
|
||||
x:Class="AtomUI.Demo.Desktop.Views.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:showcases="using:AtomUI.Demo.Desktop.ShowCase"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceInclude Source="../Themes/TabMenu.axaml" />
|
||||
<ResourceInclude Source="../Themes/ToggleButton.axaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
|
||||
</UserControl.Resources>
|
||||
<UserControl.Styles>
|
||||
<Style Selector="showcases|ShowCasePanel">
|
||||
<Setter Property="Margin" Value="0, 30, 0, 0" />
|
||||
</Style>
|
||||
<Style Selector="showcases|ShowCaseItem">
|
||||
<Setter Property="Margin" Value="0, 0, 0, 50" />
|
||||
</Style>
|
||||
</UserControl.Styles>
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<TabControl
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="8"
|
||||
Name="tab"
|
||||
Padding="20,0,0,0"
|
||||
TabStripPlacement="Left"
|
||||
FontSize="13"
|
||||
x:Name="ShowCaseNav"
|
||||
Theme="{DynamicResource NavigationTab}">
|
||||
<TabControl.Styles>
|
||||
<Style Selector="#ShowCaseNav > TabItem">
|
||||
<Setter Property="FontSize" Value="18" />
|
||||
<Setter Property="Width" Value="230" />
|
||||
</Style>
|
||||
</TabControl.Styles>
|
||||
<TabItem Header="Overview">
|
||||
<showcases:Overview />
|
||||
</TabItem>
|
||||
<TabItem Header="Palette">
|
||||
<showcases:PaletteShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="PathIcon">
|
||||
<showcases:IconShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Button">
|
||||
<showcases:ButtonShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="RadioButton">
|
||||
<showcases:RadioButtonShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="CheckBox">
|
||||
<showcases:CheckBoxShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="ToggleSwitch">
|
||||
<showcases:SwitchShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Tag">
|
||||
<showcases:TagShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Alert">
|
||||
<showcases:AlertShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Tooltip">
|
||||
<showcases:TooltipShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Separator">
|
||||
<showcases:SeparatorShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Popover">
|
||||
<showcases:PopoverShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="ProgressBar">
|
||||
<showcases:ProgressBarShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="ProgressIndicator">
|
||||
<showcases:ProgressIndicatorShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Segmented">
|
||||
<showcases:SegmentedShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Menu">
|
||||
<showcases:MenuShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Expander">
|
||||
<showcases:ExpanderShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="ComboBox">
|
||||
<showcases:ComboBoxShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="ListBox">
|
||||
<showcases:ListBoxShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Slider">
|
||||
<showcases:SliderShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="TreeView">
|
||||
<showcases:TreeViewShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="LineEdit">
|
||||
<showcases:LineEditShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="InputNumber">
|
||||
<showcases:InputNumberShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="SpinIndicator">
|
||||
<showcases:SpinIndicatorShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="TitleBar">
|
||||
<showcases:TitleBarShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Pagination">
|
||||
<showcases:PaginationShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Avatar">
|
||||
<showcases:AvatarShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Badge">
|
||||
<showcases:BadgeShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Card">
|
||||
<showcases:CardShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Empty">
|
||||
<showcases:EmptyShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="Timeline">
|
||||
<showcases:TimelineShowCase />
|
||||
</TabItem>
|
||||
<TabItem Header="TabControl">
|
||||
<showcases:TabControlShowCase />
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Grid>
|
||||
|
||||
</UserControl>
|
24
Samples/AtomUI.Demo.Desktop/Views/MainView.axaml.cs
Normal file
24
Samples/AtomUI.Demo.Desktop/Views/MainView.axaml.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Styling;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Views;
|
||||
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ToggleButton_OnIsCheckedChanged(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var app = Application.Current;
|
||||
if (app is not null)
|
||||
{
|
||||
var theme = app.ActualThemeVariant;
|
||||
app.RequestedThemeVariant = theme == ThemeVariant.Dark ? ThemeVariant.Light : ThemeVariant.Dark;
|
||||
}
|
||||
}
|
||||
}
|
16
Samples/AtomUI.Demo.Desktop/Views/MainWindow.axaml
Normal file
16
Samples/AtomUI.Demo.Desktop/Views/MainWindow.axaml
Normal file
@ -0,0 +1,16 @@
|
||||
<Window
|
||||
x:Class="AtomUI.Demo.Desktop.Views.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
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:views="clr-namespace:AtomUI.Demo.Desktop.Views"
|
||||
Title="AtomUI Demo"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:CompileBindings="True"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
MinWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<views:MainView />
|
||||
</Window>
|
15
Samples/AtomUI.Demo.Desktop/Views/MainWindow.axaml.cs
Normal file
15
Samples/AtomUI.Demo.Desktop/Views/MainWindow.axaml.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace AtomUI.Demo.Desktop.Views;
|
||||
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
#if DEBUG
|
||||
this.AttachDevTools();
|
||||
#endif
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user