mirror of
https://gitee.com/chinware/atomui.git
synced 2024-11-29 18:38:16 +08:00
* 格式化代码;
This commit is contained in:
parent
480a9be15c
commit
80638627ee
@ -1,12 +1,12 @@
|
|||||||
<Project>
|
<Project>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<LangVersion>latest</LangVersion>
|
<LangVersion>latest</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<Import Project="$(MSBuildThisFileDirectory)\build\Version.props" />
|
<Import Project="$(MSBuildThisFileDirectory)\build\Version.props"/>
|
||||||
<Import Project="$(MSBuildThisFileDirectory)\build\Output.props" />
|
<Import Project="$(MSBuildThisFileDirectory)\build\Output.props"/>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<!-- https://github.com/dotnet/sdk/issues/22515-->
|
<!-- https://github.com/dotnet/sdk/issues/22515-->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Remove="*.csproj.DotSettings" />
|
<None Remove="*.csproj.DotSettings"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
@ -1,11 +1,11 @@
|
|||||||
|
using AtomUI.Demo.Desktop.Views;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls.ApplicationLifetimes;
|
using Avalonia.Controls.ApplicationLifetimes;
|
||||||
using Avalonia.Markup.Xaml;
|
using Avalonia.Markup.Xaml;
|
||||||
using AtomUI.Demo.Desktop.Views;
|
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop;
|
namespace AtomUI.Demo.Desktop;
|
||||||
|
|
||||||
public partial class App : Application
|
public class App : Application
|
||||||
{
|
{
|
||||||
public override void Initialize()
|
public override void Initialize()
|
||||||
{
|
{
|
||||||
|
@ -1 +1,43 @@
|
|||||||
<svg width="130" height="80" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient x1="52.348%" y1="74.611%" x2="52.348%" y2="-17.635%" id="a"><stop stop-color="#DEDEDE" stop-opacity="0" offset="0%"/><stop stop-color="#A9A9A9" stop-opacity=".3" offset="100%"/></linearGradient><linearGradient x1="44.79%" y1="100%" x2="44.79%" y2="0%" id="b"><stop stop-color="#FFF" stop-opacity="0" offset="0%"/><stop stop-color="#96A1C5" stop-opacity=".373" offset="100%"/></linearGradient><linearGradient x1="50%" y1="100%" x2="50%" y2="-19.675%" id="c"><stop stop-color="#FFF" stop-opacity="0" offset="0%"/><stop stop-color="#919191" stop-opacity=".15" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="44.95%" id="d"><stop stop-color="#5389F5" offset="0%"/><stop stop-color="#416FDC" offset="100%"/></linearGradient><linearGradient x1="63.345%" y1="100%" x2="63.345%" y2="-5.316%" id="e"><stop stop-color="#DCE9FF" offset="0%"/><stop stop-color="#B6CFFF" offset="100%"/></linearGradient><linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="f"><stop stop-color="#7CA5F7" offset="0%"/><stop stop-color="#C4D6FC" offset="100%"/></linearGradient></defs><g transform="translate(-1.866 .364)" fill="none" fill-rule="evenodd"><path d="M27.94 14.864c1.326-4.192 2.56-6.802 3.7-7.831 3.157-2.848 7.522-1.298 8.45-1.076 3.26.782 2.2-4.364 4.997-5.41 1.864-.697 3.397.155 4.6 2.556C50.752.863 52.375-.163 54.556.02c3.272.277 4.417 11.328 8.913 8.909 4.497-2.42 10.01-2.973 12.365.623.509.778.704-.429 4.166-4.55C83.462.88 86.914-.936 93.996 1.464c3.22 1.09 5.868 4.045 7.947 8.864 0 6.878 5.06 10.95 15.178 12.213 15.179 1.895 3.397 18.214-15.178 22.993-18.576 4.78-61.343 7.36-84.551-4.716C1.92 32.769 5.436 24.117 27.939 14.864z" fill="url(#a)" opacity=".8"/><ellipse fill="url(#b)" cx="66" cy="69.166" rx="27.987" ry="6.478"/><path d="M113.25 77.249c-21.043 5.278-92.87-.759-100.515-3.516-3.721-1.343-7.075-3.868-10.061-7.576a2.822 2.822 0 0 1 2.198-4.593h125.514c2.605 6.938-3.107 12.166-17.136 15.685z" fill="url(#c)" opacity=".675"/><g fill-rule="nonzero"><path d="M43.396 12.098L33.825.906a2.434 2.434 0 0 0-1.837-.86h-20.58c-.706 0-1.377.324-1.837.86L0 12.098v6.144h43.396v-6.144z" fill="url(#d)" transform="translate(44.08 39.707)"/><path d="M40.684 18.468L32.307 8.72a2.136 2.136 0 0 0-1.622-.725H12.711c-.617 0-1.22.256-1.622.725l-8.377 9.748v5.354h37.972v-5.354z" fill="url(#e)" transform="translate(44.08 39.707)"/><path d="M43.396 25.283c0 .853-.384 1.62-.99 2.134l-.123.1a2.758 2.758 0 0 1-1.67.56H2.784c-.342 0-.669-.062-.971-.176l-.15-.06A2.802 2.802 0 0 1 0 25.282V12.165h10.529c1.163 0 2.1.957 2.1 2.118v.015c0 1.162.948 2.099 2.111 2.099h13.916a2.113 2.113 0 0 0 2.111-2.107c0-1.166.938-2.125 2.1-2.125h10.53z" fill="url(#f)" transform="translate(44.08 39.707)"/></g></g></svg>
|
<svg width="130" height="80" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<defs>
|
||||||
|
<linearGradient x1="52.348%" y1="74.611%" x2="52.348%" y2="-17.635%" id="a">
|
||||||
|
<stop stop-color="#DEDEDE" stop-opacity="0" offset="0%"/>
|
||||||
|
<stop stop-color="#A9A9A9" stop-opacity=".3" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="44.79%" y1="100%" x2="44.79%" y2="0%" id="b">
|
||||||
|
<stop stop-color="#FFF" stop-opacity="0" offset="0%"/>
|
||||||
|
<stop stop-color="#96A1C5" stop-opacity=".373" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="100%" x2="50%" y2="-19.675%" id="c">
|
||||||
|
<stop stop-color="#FFF" stop-opacity="0" offset="0%"/>
|
||||||
|
<stop stop-color="#919191" stop-opacity=".15" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="44.95%" id="d">
|
||||||
|
<stop stop-color="#5389F5" offset="0%"/>
|
||||||
|
<stop stop-color="#416FDC" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="63.345%" y1="100%" x2="63.345%" y2="-5.316%" id="e">
|
||||||
|
<stop stop-color="#DCE9FF" offset="0%"/>
|
||||||
|
<stop stop-color="#B6CFFF" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
<linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="f">
|
||||||
|
<stop stop-color="#7CA5F7" offset="0%"/>
|
||||||
|
<stop stop-color="#C4D6FC" offset="100%"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<g transform="translate(-1.866 .364)" fill="none" fill-rule="evenodd">
|
||||||
|
<path d="M27.94 14.864c1.326-4.192 2.56-6.802 3.7-7.831 3.157-2.848 7.522-1.298 8.45-1.076 3.26.782 2.2-4.364 4.997-5.41 1.864-.697 3.397.155 4.6 2.556C50.752.863 52.375-.163 54.556.02c3.272.277 4.417 11.328 8.913 8.909 4.497-2.42 10.01-2.973 12.365.623.509.778.704-.429 4.166-4.55C83.462.88 86.914-.936 93.996 1.464c3.22 1.09 5.868 4.045 7.947 8.864 0 6.878 5.06 10.95 15.178 12.213 15.179 1.895 3.397 18.214-15.178 22.993-18.576 4.78-61.343 7.36-84.551-4.716C1.92 32.769 5.436 24.117 27.939 14.864z"
|
||||||
|
fill="url(#a)" opacity=".8"/>
|
||||||
|
<ellipse fill="url(#b)" cx="66" cy="69.166" rx="27.987" ry="6.478"/>
|
||||||
|
<path d="M113.25 77.249c-21.043 5.278-92.87-.759-100.515-3.516-3.721-1.343-7.075-3.868-10.061-7.576a2.822 2.822 0 0 1 2.198-4.593h125.514c2.605 6.938-3.107 12.166-17.136 15.685z"
|
||||||
|
fill="url(#c)" opacity=".675"/>
|
||||||
|
<g fill-rule="nonzero">
|
||||||
|
<path d="M43.396 12.098L33.825.906a2.434 2.434 0 0 0-1.837-.86h-20.58c-.706 0-1.377.324-1.837.86L0 12.098v6.144h43.396v-6.144z"
|
||||||
|
fill="url(#d)" transform="translate(44.08 39.707)"/>
|
||||||
|
<path d="M40.684 18.468L32.307 8.72a2.136 2.136 0 0 0-1.622-.725H12.711c-.617 0-1.22.256-1.622.725l-8.377 9.748v5.354h37.972v-5.354z"
|
||||||
|
fill="url(#e)" transform="translate(44.08 39.707)"/>
|
||||||
|
<path d="M43.396 25.283c0 .853-.384 1.62-.99 2.134l-.123.1a2.758 2.758 0 0 1-1.67.56H2.784c-.342 0-.669-.062-.971-.176l-.15-.06A2.802 2.802 0 0 1 0 25.282V12.165h10.529c1.163 0 2.1.957 2.1 2.118v.015c0 1.162.948 2.099 2.111 2.099h13.916a2.113 2.113 0 0 0 2.111-2.107c0-1.166.938-2.125 2.1-2.125h10.53z"
|
||||||
|
fill="url(#f)" transform="translate(44.08 39.707)"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 3.2 KiB |
@ -1,6 +1,6 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<Import Project="$(MSBuildThisFileDirectory)..\..\Build\Output.App.props" />
|
<Import Project="$(MSBuildThisFileDirectory)..\..\Build\Output.App.props"/>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<OutputType>WinExe</OutputType>
|
<OutputType>WinExe</OutputType>
|
||||||
@ -9,8 +9,8 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AvaloniaResource Include="Assets\**" />
|
<AvaloniaResource Include="Assets\**"/>
|
||||||
<TrimmerRootDescriptor Include="Roots.xml" />
|
<TrimmerRootDescriptor Include="Roots.xml"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
@ -19,19 +19,19 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Avalonia" />
|
<PackageReference Include="Avalonia"/>
|
||||||
<PackageReference Include="Avalonia.Desktop" />
|
<PackageReference Include="Avalonia.Desktop"/>
|
||||||
<PackageReference Include="Avalonia.Themes.Fluent" />
|
<PackageReference Include="Avalonia.Themes.Fluent"/>
|
||||||
<PackageReference Include="Avalonia.Controls.DataGrid" />
|
<PackageReference Include="Avalonia.Controls.DataGrid"/>
|
||||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
|
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics"/>
|
||||||
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Nlnet.Avalonia.DevTools" />
|
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Nlnet.Avalonia.DevTools"/>
|
||||||
<PackageReference Include="CommunityToolkit.Mvvm" />
|
<PackageReference Include="CommunityToolkit.Mvvm"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\..\src\AtomUI.Controls\AtomUI.Controls.csproj" />
|
<ProjectReference Include="..\..\src\AtomUI.Controls\AtomUI.Controls.csproj"/>
|
||||||
<ProjectReference Include="..\..\src\AtomUI.Icon.AntDesign\AtomUI.Icon.AntDesign.csproj" />
|
<ProjectReference Include="..\..\src\AtomUI.Icon.AntDesign\AtomUI.Icon.AntDesign.csproj"/>
|
||||||
<ProjectReference Include="..\..\src\AtomUI.Theme\AtomUI.Theme.csproj" />
|
<ProjectReference Include="..\..\src\AtomUI.Theme\AtomUI.Theme.csproj"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -1,61 +1,65 @@
|
|||||||
|
using AtomUI.Controls;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.LogicalTree;
|
using Avalonia.LogicalTree;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
|
using Separator = AtomUI.Controls.Separator;
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop;
|
namespace AtomUI.Demo.Desktop;
|
||||||
|
|
||||||
public class ShowCaseItem : ContentControl
|
public class ShowCaseItem : ContentControl
|
||||||
{
|
{
|
||||||
private bool _initialized = false;
|
private bool _initialized;
|
||||||
public string Title { get; set; } = string.Empty;
|
public string Title { get; set; } = string.Empty;
|
||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
private void SetupUi()
|
private void SetupUi()
|
||||||
{
|
{
|
||||||
var mainLayout = new StackPanel();
|
var mainLayout = new StackPanel();
|
||||||
var showCaseTitle = new AtomUI.Controls.Separator()
|
var showCaseTitle = new Separator
|
||||||
{
|
{
|
||||||
Title = Title,
|
Title = Title,
|
||||||
TitlePosition = AtomUI.Controls.SeparatorTitlePosition.Left,
|
TitlePosition = SeparatorTitlePosition.Left,
|
||||||
FontWeight = FontWeight.Bold,
|
FontWeight = FontWeight.Bold
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Content is Control contentControl) {
|
if (Content is Control contentControl)
|
||||||
LogicalChildren.Remove(contentControl);
|
{
|
||||||
mainLayout.Children.Add(contentControl);
|
LogicalChildren.Remove(contentControl);
|
||||||
}
|
mainLayout.Children.Add(contentControl);
|
||||||
|
}
|
||||||
mainLayout.Children.Add(new Border
|
|
||||||
{
|
|
||||||
Height = 10,
|
|
||||||
Background = Brushes.Transparent
|
|
||||||
});
|
|
||||||
mainLayout.Children.Add(showCaseTitle);
|
|
||||||
mainLayout.Children.Add(new TextBlock()
|
|
||||||
{
|
|
||||||
Text = Description,
|
|
||||||
TextWrapping = TextWrapping.Wrap,
|
|
||||||
Margin = new Thickness(0, 10, 0, 0)
|
|
||||||
});
|
|
||||||
|
|
||||||
var outerBorder = new Border()
|
|
||||||
{
|
|
||||||
BorderBrush = new SolidColorBrush(new Color(10, 5, 5, 5)),
|
|
||||||
BorderThickness = new Thickness(1),
|
|
||||||
Padding = new Thickness(20),
|
|
||||||
Child = mainLayout,
|
|
||||||
CornerRadius = new CornerRadius(8)
|
|
||||||
};
|
|
||||||
|
|
||||||
Content = outerBorder;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
mainLayout.Children.Add(new Border
|
||||||
{
|
{
|
||||||
if (!_initialized) {
|
Height = 10,
|
||||||
SetupUi();
|
Background = Brushes.Transparent
|
||||||
_initialized = true;
|
});
|
||||||
}
|
mainLayout.Children.Add(showCaseTitle);
|
||||||
}
|
mainLayout.Children.Add(new TextBlock
|
||||||
|
{
|
||||||
|
Text = Description,
|
||||||
|
TextWrapping = TextWrapping.Wrap,
|
||||||
|
Margin = new Thickness(0, 10, 0, 0)
|
||||||
|
});
|
||||||
|
|
||||||
|
var outerBorder = new Border
|
||||||
|
{
|
||||||
|
BorderBrush = new SolidColorBrush(new Color(10, 5, 5, 5)),
|
||||||
|
BorderThickness = new Thickness(1),
|
||||||
|
Padding = new Thickness(20),
|
||||||
|
Child = mainLayout,
|
||||||
|
CornerRadius = new CornerRadius(8)
|
||||||
|
};
|
||||||
|
|
||||||
|
Content = outerBorder;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||||
|
{
|
||||||
|
if (!_initialized)
|
||||||
|
{
|
||||||
|
SetupUi();
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -10,83 +10,82 @@ namespace AtomUI.Demo.Desktop;
|
|||||||
|
|
||||||
public class ShowCasePanel : Control
|
public class ShowCasePanel : Control
|
||||||
{
|
{
|
||||||
public string? Id { get; protected set; }
|
private bool _initialized;
|
||||||
private bool _initialized = false;
|
private StackPanel _leftContainer = default!;
|
||||||
private StackPanel _leftContainer = default!;
|
private StackPanel _rightContainer = default!;
|
||||||
private StackPanel _rightContainer = default!;
|
|
||||||
|
|
||||||
[Content]
|
|
||||||
public AvaloniaControlList Children { get; } = new AvaloniaControlList();
|
|
||||||
|
|
||||||
public ShowCasePanel()
|
public string? Id { get; protected set; }
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void SetupUi()
|
[Content] public AvaloniaControlList Children { get; } = new();
|
||||||
{
|
|
||||||
var mainLayout = new UniformGrid()
|
|
||||||
{
|
|
||||||
Rows = 1,
|
|
||||||
Columns = 2,
|
|
||||||
Margin = new Thickness(0)
|
|
||||||
};
|
|
||||||
_leftContainer = new StackPanel()
|
|
||||||
{
|
|
||||||
Orientation = Orientation.Vertical,
|
|
||||||
Spacing = 10,
|
|
||||||
Margin = new Thickness(0, 0, 10, 0),
|
|
||||||
};
|
|
||||||
_rightContainer = new StackPanel()
|
|
||||||
{
|
|
||||||
Orientation = Orientation.Vertical,
|
|
||||||
Spacing = 10,
|
|
||||||
};
|
|
||||||
mainLayout.Children.Add(_leftContainer);
|
|
||||||
mainLayout.Children.Add(_rightContainer);
|
|
||||||
|
|
||||||
for (int i = 0; i < Children.Count; ++i) {
|
protected void SetupUi()
|
||||||
var control = Children[i];
|
{
|
||||||
if (i % 2 == 0) {
|
var mainLayout = new UniformGrid
|
||||||
_leftContainer.Children.Add(control);
|
{
|
||||||
} else {
|
Rows = 1,
|
||||||
_rightContainer.Children.Add(control);
|
Columns = 2,
|
||||||
}
|
Margin = new Thickness(0)
|
||||||
}
|
};
|
||||||
var scrollView = new ScrollViewer()
|
_leftContainer = new StackPanel
|
||||||
{
|
{
|
||||||
Content = mainLayout,
|
Orientation = Orientation.Vertical,
|
||||||
};
|
Spacing = 10,
|
||||||
LogicalChildren.Add(scrollView);
|
Margin = new Thickness(0, 0, 10, 0)
|
||||||
VisualChildren.Add(scrollView);
|
};
|
||||||
}
|
_rightContainer = new StackPanel
|
||||||
|
{
|
||||||
|
Orientation = Orientation.Vertical,
|
||||||
|
Spacing = 10
|
||||||
|
};
|
||||||
|
mainLayout.Children.Add(_leftContainer);
|
||||||
|
mainLayout.Children.Add(_rightContainer);
|
||||||
|
|
||||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
for (var i = 0; i < Children.Count; ++i)
|
||||||
{
|
{
|
||||||
if (!_initialized) {
|
var control = Children[i];
|
||||||
SetupUi();
|
if (i % 2 == 0)
|
||||||
NotifyShowCaseLayoutReady();
|
_leftContainer.Children.Add(control);
|
||||||
_initialized = true;
|
else
|
||||||
}
|
_rightContainer.Children.Add(control);
|
||||||
base.OnAttachedToLogicalTree(e);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
internal virtual void NotifyAboutToActive()
|
var scrollView = new ScrollViewer
|
||||||
{
|
{
|
||||||
}
|
Content = mainLayout
|
||||||
|
};
|
||||||
|
LogicalChildren.Add(scrollView);
|
||||||
|
VisualChildren.Add(scrollView);
|
||||||
|
}
|
||||||
|
|
||||||
internal virtual void NotifyActivated()
|
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
}
|
if (!_initialized)
|
||||||
|
{
|
||||||
|
SetupUi();
|
||||||
|
NotifyShowCaseLayoutReady();
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
internal virtual void NotifyAboutToDeactivated()
|
base.OnAttachedToLogicalTree(e);
|
||||||
{
|
}
|
||||||
}
|
|
||||||
|
|
||||||
internal virtual void NotifyDeactivated()
|
internal virtual void NotifyAboutToActive()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void NotifyShowCaseLayoutReady()
|
internal virtual void NotifyActivated()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal virtual void NotifyAboutToDeactivated()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
internal virtual void NotifyDeactivated()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void NotifyShowCaseLayoutReady()
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
@ -39,4 +39,4 @@
|
|||||||
<Setter Property="TextBlock.IsVisible" Value="True" />
|
<Setter Property="TextBlock.IsVisible" Value="True" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
@ -1,15 +1,19 @@
|
|||||||
|
using AtomUI.Demo.Desktop.ViewModels;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using AtomUI.Demo.Desktop.ViewModels;
|
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop.Controls;
|
namespace AtomUI.Demo.Desktop.Controls;
|
||||||
|
|
||||||
public class ColorItemControl : TemplatedControl
|
public class ColorItemControl : TemplatedControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<string?> ColorNameProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
public static readonly StyledProperty<string?> ColorNameProperty =
|
||||||
nameof(ColorName));
|
AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||||
|
nameof(ColorName));
|
||||||
|
|
||||||
|
public static readonly StyledProperty<string?> HexProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
||||||
|
nameof(Hex));
|
||||||
|
|
||||||
public string? ColorName
|
public string? ColorName
|
||||||
{
|
{
|
||||||
@ -17,22 +21,15 @@ public class ColorItemControl : TemplatedControl
|
|||||||
set => SetValue(ColorNameProperty, value);
|
set => SetValue(ColorNameProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly StyledProperty<string?> HexProperty = AvaloniaProperty.Register<ColorItemControl, string?>(
|
|
||||||
nameof(Hex));
|
|
||||||
|
|
||||||
public string? Hex
|
public string? Hex
|
||||||
{
|
{
|
||||||
get => GetValue(HexProperty);
|
get => GetValue(HexProperty);
|
||||||
set => SetValue(HexProperty, value);
|
set => SetValue(HexProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnPointerPressed(e);
|
base.OnPointerPressed(e);
|
||||||
if (this.DataContext is ColorItemViewModel v)
|
if (DataContext is ColorItemViewModel v) WeakReferenceMessenger.Default.Send(v);
|
||||||
{
|
|
||||||
WeakReferenceMessenger.Default.Send(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,12 +6,13 @@ namespace AtomUI.Demo.Desktop.Controls;
|
|||||||
|
|
||||||
public class ColorListControl : TemplatedControl
|
public class ColorListControl : TemplatedControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<ColorListViewModel> ListDataProperty = AvaloniaProperty.Register<ColorListGroupControl, ColorListViewModel>(
|
public static readonly StyledProperty<ColorListViewModel> ListDataProperty =
|
||||||
nameof(ListData), new ColorListViewModel());
|
AvaloniaProperty.Register<ColorListGroupControl, ColorListViewModel>(
|
||||||
|
nameof(ListData), new ColorListViewModel());
|
||||||
|
|
||||||
public ColorListViewModel ListData
|
public ColorListViewModel ListData
|
||||||
{
|
{
|
||||||
get => GetValue(ListDataProperty);
|
get => GetValue(ListDataProperty);
|
||||||
set => SetValue(ListDataProperty, value);
|
set => SetValue(ListDataProperty, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,12 +6,13 @@ namespace AtomUI.Demo.Desktop.Controls;
|
|||||||
|
|
||||||
public class ColorListGroupControl : TemplatedControl
|
public class ColorListGroupControl : TemplatedControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<ColorGroupViewModel> GroupDataProperty = AvaloniaProperty.Register<ColorListGroupControl, ColorGroupViewModel>(
|
public static readonly StyledProperty<ColorGroupViewModel> GroupDataProperty =
|
||||||
nameof(GroupData), new ColorGroupViewModel());
|
AvaloniaProperty.Register<ColorListGroupControl, ColorGroupViewModel>(
|
||||||
|
nameof(GroupData), new ColorGroupViewModel());
|
||||||
|
|
||||||
public ColorGroupViewModel GroupData
|
public ColorGroupViewModel GroupData
|
||||||
{
|
{
|
||||||
get => GetValue(GroupDataProperty);
|
get => GetValue(GroupDataProperty);
|
||||||
set => SetValue(GroupDataProperty, value);
|
set => SetValue(GroupDataProperty, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,50 +1,47 @@
|
|||||||
|
using AtomUI.Demo.Desktop.ViewModels;
|
||||||
|
using AtomUI.Icon;
|
||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using CommunityToolkit.Mvvm.Messaging;
|
|
||||||
using AtomUI.Demo.Desktop.ViewModels;
|
|
||||||
using AtomUI.Icon;
|
|
||||||
using Avalonia.LogicalTree;
|
using Avalonia.LogicalTree;
|
||||||
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop.Controls;
|
namespace AtomUI.Demo.Desktop.Controls;
|
||||||
|
|
||||||
public class IconGallery : TemplatedControl
|
public class IconGallery : TemplatedControl
|
||||||
{
|
{
|
||||||
private bool _initialized = false;
|
public static readonly StyledProperty<IconThemeType?> IconThemeTypeProperty =
|
||||||
private IconGalleryModel _galleryModel;
|
AvaloniaProperty.Register<IconInfoItem, IconThemeType?>(
|
||||||
|
nameof(IconThemeType));
|
||||||
public static readonly StyledProperty<IconThemeType?> IconThemeTypeProperty = AvaloniaProperty.Register<IconInfoItem, IconThemeType?>(
|
|
||||||
nameof(IconThemeType));
|
|
||||||
|
|
||||||
public IconThemeType? IconThemeType
|
private readonly IconGalleryModel _galleryModel;
|
||||||
{
|
private bool _initialized;
|
||||||
get => GetValue(IconThemeTypeProperty);
|
|
||||||
set => SetValue(IconThemeTypeProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public IconGallery()
|
public IconGallery()
|
||||||
{
|
{
|
||||||
_galleryModel = new IconGalleryModel();
|
_galleryModel = new IconGalleryModel();
|
||||||
DataContext = _galleryModel;
|
DataContext = _galleryModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
public IconThemeType? IconThemeType
|
||||||
{
|
{
|
||||||
base.OnPointerPressed(e);
|
get => GetValue(IconThemeTypeProperty);
|
||||||
if (this.DataContext is ColorItemViewModel v) {
|
set => SetValue(IconThemeTypeProperty, value);
|
||||||
WeakReferenceMessenger.Default.Send(v);
|
}
|
||||||
}
|
|
||||||
}
|
protected override void OnPointerPressed(PointerPressedEventArgs e)
|
||||||
|
{
|
||||||
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
base.OnPointerPressed(e);
|
||||||
{
|
if (DataContext is ColorItemViewModel v) WeakReferenceMessenger.Default.Send(v);
|
||||||
base.OnAttachedToLogicalTree(e);
|
}
|
||||||
if (!_initialized) {
|
|
||||||
if (IconThemeType.HasValue) {
|
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
|
||||||
_galleryModel.LoadThemeIcons(IconThemeType.Value);
|
{
|
||||||
}
|
base.OnAttachedToLogicalTree(e);
|
||||||
_initialized = true;
|
if (!_initialized)
|
||||||
}
|
{
|
||||||
}
|
if (IconThemeType.HasValue) _galleryModel.LoadThemeIcons(IconThemeType.Value);
|
||||||
|
_initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,21 +5,21 @@ namespace AtomUI.Demo.Desktop.Controls;
|
|||||||
|
|
||||||
public class IconInfoItem : TemplatedControl
|
public class IconInfoItem : TemplatedControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<string> IconNameProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
public static readonly StyledProperty<string> IconNameProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
||||||
nameof(IconName));
|
nameof(IconName));
|
||||||
|
|
||||||
public string IconName
|
public static readonly StyledProperty<string> IconKindProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
||||||
{
|
nameof(IconKind));
|
||||||
get => GetValue(IconNameProperty);
|
|
||||||
set => SetValue(IconNameProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly StyledProperty<string> IconKindProperty = AvaloniaProperty.Register<IconInfoItem, string>(
|
|
||||||
nameof(IconKind));
|
|
||||||
|
|
||||||
public string IconKind
|
public string IconName
|
||||||
{
|
{
|
||||||
get => GetValue(IconKindProperty);
|
get => GetValue(IconNameProperty);
|
||||||
set => SetValue(IconKindProperty, value);
|
set => SetValue(IconNameProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string IconKind
|
||||||
|
{
|
||||||
|
get => GetValue(IconKindProperty);
|
||||||
|
set => SetValue(IconKindProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,41 +4,43 @@ using AtomUI.Theme;
|
|||||||
using Avalonia;
|
using Avalonia;
|
||||||
using Avalonia.Dialogs;
|
using Avalonia.Dialogs;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
using Nlnet.Avalonia.DevTools;
|
using Nlnet.Avalonia.DevTools;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop;
|
namespace AtomUI.Demo.Desktop;
|
||||||
|
|
||||||
class Program
|
internal class Program
|
||||||
{
|
{
|
||||||
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
// Initialization code. Don't use any Avalonia, third-party APIs or any
|
||||||
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
// SynchronizationContext-reliant code before AppMain is called: things aren't initialized
|
||||||
// yet and stuff might break.
|
// yet and stuff might break.
|
||||||
[STAThread]
|
[STAThread]
|
||||||
public static void Main(string[] args) => BuildAvaloniaApp()
|
public static void Main(string[] args)
|
||||||
.With(new FontManagerOptions
|
{
|
||||||
{
|
BuildAvaloniaApp()
|
||||||
FontFallbacks = new[]
|
.With(new FontManagerOptions
|
||||||
{
|
{
|
||||||
new FontFallback
|
FontFallbacks = new[]
|
||||||
{
|
{
|
||||||
FontFamily = new FontFamily("Microsoft YaHei")
|
new FontFallback
|
||||||
}
|
{
|
||||||
}
|
FontFamily = new FontFamily("Microsoft YaHei")
|
||||||
})
|
}
|
||||||
.StartWithClassicDesktopLifetime(args);
|
}
|
||||||
|
})
|
||||||
public static AppBuilder BuildAvaloniaApp()
|
.StartWithClassicDesktopLifetime(args);
|
||||||
=> AppBuilder.Configure<App>()
|
}
|
||||||
.UseManagedSystemDialogs()
|
|
||||||
.UsePlatformDetect()
|
public static AppBuilder BuildAvaloniaApp()
|
||||||
.UseAtomUI()
|
=> AppBuilder.Configure<App>()
|
||||||
|
.UseManagedSystemDialogs()
|
||||||
|
.UsePlatformDetect()
|
||||||
|
.UseAtomUI()
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
.UseDevToolsForAvalonia()
|
.UseDevToolsForAvalonia()
|
||||||
#endif
|
#endif
|
||||||
.UseIconPackage<AntDesignIconPackage>(true)
|
.UseIconPackage<AntDesignIconPackage>(true)
|
||||||
.With(new Win32PlatformOptions())
|
.With(new Win32PlatformOptions())
|
||||||
.LogToTrace();
|
.LogToTrace();
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
|
|
||||||
@ -15,7 +14,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="More types" Description="There are 4 types of Alert: success, info, warning, error.">
|
<desktop:ShowCaseItem Title="More types"
|
||||||
|
Description="There are 4 types of Alert: success, info, warning, error.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:Alert Type="Success">Success Text</atom:Alert>
|
<atom:Alert Type="Success">Success Text</atom:Alert>
|
||||||
<atom:Alert Type="Info">Info Text</atom:Alert>
|
<atom:Alert Type="Info">Info Text</atom:Alert>
|
||||||
@ -29,9 +29,10 @@
|
|||||||
<atom:Alert IsClosable="True" Type="Warning">
|
<atom:Alert IsClosable="True" Type="Warning">
|
||||||
Warning Text Warning Text Warning Text Warning Text Warning Text Warning TextWarning Text
|
Warning Text Warning Text Warning Text Warning Text Warning Text Warning TextWarning Text
|
||||||
</atom:Alert>
|
</atom:Alert>
|
||||||
<atom:Alert Description="Error Description Error Description Error Description Error Description Error Description Error Description"
|
<atom:Alert
|
||||||
IsClosable="True"
|
Description="Error Description Error Description Error Description Error Description Error Description Error Description"
|
||||||
Type="Error">
|
IsClosable="True"
|
||||||
|
Type="Error">
|
||||||
Error Text
|
Error Text
|
||||||
</atom:Alert>
|
</atom:Alert>
|
||||||
<atom:Alert CloseIcon="{atom:IconProvider CloseSquareFilled}"
|
<atom:Alert CloseIcon="{atom:IconProvider CloseSquareFilled}"
|
||||||
@ -51,9 +52,10 @@
|
|||||||
<atom:Alert Description="Info Description Info Description Info Description Info Description"
|
<atom:Alert Description="Info Description Info Description Info Description Info Description"
|
||||||
Message="Info Text"
|
Message="Info Text"
|
||||||
Type="Info" />
|
Type="Info" />
|
||||||
<atom:Alert Description="Warning Description Warning Description Warning Description Warning Description"
|
<atom:Alert
|
||||||
Message="Warning Text"
|
Description="Warning Description Warning Description Warning Description Warning Description"
|
||||||
Type="Warning" />
|
Message="Warning Text"
|
||||||
|
Type="Warning" />
|
||||||
<atom:Alert Description="Error Description Error Description Error Description Error Description"
|
<atom:Alert Description="Error Description Error Description Error Description Error Description"
|
||||||
Message="Error Text"
|
Message="Error Text"
|
||||||
Type="Error" />
|
Type="Error" />
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class AlertShowCase : UserControl
|
public partial class AlertShowCase : UserControl
|
||||||
{
|
{
|
||||||
public AlertShowCase()
|
public AlertShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.AvatarShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.AvatarShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class AvatarShowCase : UserControl
|
public partial class AvatarShowCase : UserControl
|
||||||
{
|
{
|
||||||
public AvatarShowCase()
|
public AvatarShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,11 +5,11 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Simplest Usage. Badge will be hidden when count is 0, but we can use showZero to show it.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="Simplest Usage. Badge will be hidden when count is 0, but we can use showZero to show it.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||||
<atom:CountBadge Count="5">
|
<atom:CountBadge Count="5">
|
||||||
<Border Width="40"
|
<Border Width="40"
|
||||||
@ -26,7 +26,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Overflow Count" Description="${overflowCount}+ is displayed when count is larger than overflowCount. The default value of overflowCount is 99.">
|
<desktop:ShowCaseItem Title="Overflow Count"
|
||||||
|
Description="${overflowCount}+ is displayed when count is larger than overflowCount. The default value of overflowCount is 99.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||||
<atom:CountBadge Count="99">
|
<atom:CountBadge Count="99">
|
||||||
<Border Width="40"
|
<Border Width="40"
|
||||||
@ -55,7 +56,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Offset" Description="Set offset of the badge dot, the format is [left, top], which represents the offset of the status dot from the left and top of the default position.">
|
<desktop:ShowCaseItem Title="Offset"
|
||||||
|
Description="Set offset of the badge dot, the format is [left, top], which represents the offset of the status dot from the left and top of the default position.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="20">
|
<StackPanel Orientation="Horizontal" Spacing="20">
|
||||||
<atom:CountBadge Count="5" Offset="10, 10">
|
<atom:CountBadge Count="5" Offset="10, 10">
|
||||||
<Border Width="40"
|
<Border Width="40"
|
||||||
@ -118,12 +120,14 @@
|
|||||||
Background="rgb(191,191,191)"
|
Background="rgb(191,191,191)"
|
||||||
CornerRadius="8" />
|
CornerRadius="8" />
|
||||||
</atom:DotBadge>
|
</atom:DotBadge>
|
||||||
<atom:ToggleSwitch VerticalAlignment="Center" IsChecked="{Binding DynamicDotBadgeVisible, Mode=TwoWay}" />
|
<atom:ToggleSwitch VerticalAlignment="Center"
|
||||||
|
IsChecked="{Binding DynamicDotBadgeVisible, Mode=TwoWay}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Red badge" Description="This will simply display a red badge, without a specific count. If count equals 0, it won't display the dot.">
|
<desktop:ShowCaseItem Title="Red badge"
|
||||||
|
Description="This will simply display a red badge, without a specific count. If count equals 0, it won't display the dot.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<atom:DotBadge Offset="15,9">
|
<atom:DotBadge Offset="15,9">
|
||||||
@ -294,7 +298,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Colorful Badge" Description="We preset a series of colorful Badge styles for use in different situations. You can also set it to a hex color string for custom color.">
|
<desktop:ShowCaseItem Title="Colorful Badge"
|
||||||
|
Description="We preset a series of colorful Badge styles for use in different situations. You can also set it to a hex color string for custom color.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:Separator Title="Presets"
|
<atom:Separator Title="Presets"
|
||||||
FontWeight="SemiBold"
|
FontWeight="SemiBold"
|
||||||
|
@ -5,99 +5,103 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class BadgeShowCase : UserControl
|
public partial class BadgeShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<double> DynamicBadgeCountProperty =
|
public static readonly StyledProperty<double> DynamicBadgeCountProperty =
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(DynamicBadgeCount), 5);
|
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(DynamicBadgeCount), 5);
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> DynamicDotBadgeVisibleProperty =
|
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(DynamicDotBadgeVisible), true);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> StandaloneSwitchCheckedProperty =
|
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(StandaloneSwitchChecked), true);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<double> StandaloneBadgeCount1Property =
|
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount1), 11);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<double> StandaloneBadgeCount2Property =
|
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount2), 25);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<double> StandaloneBadgeCount3Property =
|
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount3), 109);
|
|
||||||
|
|
||||||
public double DynamicBadgeCount
|
|
||||||
{
|
|
||||||
get => GetValue(DynamicBadgeCountProperty);
|
|
||||||
set => SetValue(DynamicBadgeCountProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool DynamicDotBadgeVisible
|
|
||||||
{
|
|
||||||
get => GetValue(DynamicDotBadgeVisibleProperty);
|
|
||||||
set => SetValue(DynamicDotBadgeVisibleProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool StandaloneSwitchChecked
|
|
||||||
{
|
|
||||||
get => GetValue(StandaloneSwitchCheckedProperty);
|
|
||||||
set => SetValue(StandaloneSwitchCheckedProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double StandaloneBadgeCount1
|
|
||||||
{
|
|
||||||
get => GetValue(StandaloneBadgeCount1Property);
|
|
||||||
set => SetValue(StandaloneBadgeCount1Property, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double StandaloneBadgeCount2
|
|
||||||
{
|
|
||||||
get => GetValue(StandaloneBadgeCount2Property);
|
|
||||||
set => SetValue(StandaloneBadgeCount2Property, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public double StandaloneBadgeCount3
|
|
||||||
{
|
|
||||||
get => GetValue(StandaloneBadgeCount3Property);
|
|
||||||
set => SetValue(StandaloneBadgeCount3Property, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public BadgeShowCase()
|
|
||||||
{
|
|
||||||
DataContext = this;
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddDynamicBadgeCount()
|
|
||||||
{
|
|
||||||
DynamicBadgeCount += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SubDynamicBadgeCount()
|
public static readonly StyledProperty<bool> DynamicDotBadgeVisibleProperty =
|
||||||
{
|
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(DynamicDotBadgeVisible), true);
|
||||||
var value = DynamicBadgeCount;
|
|
||||||
value -= 1;
|
|
||||||
value = Math.Max(value, 0);
|
|
||||||
DynamicBadgeCount = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RandomDynamicBadgeCount()
|
|
||||||
{
|
|
||||||
var random = new Random();
|
|
||||||
DynamicBadgeCount = random.Next(0, 110);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs args)
|
public static readonly StyledProperty<bool> StandaloneSwitchCheckedProperty =
|
||||||
{
|
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(StandaloneSwitchChecked), true);
|
||||||
base.OnPropertyChanged(args);
|
|
||||||
if (args.Property == StandaloneSwitchCheckedProperty) {
|
public static readonly StyledProperty<double> StandaloneBadgeCount1Property =
|
||||||
var isChecked = args.GetNewValue<bool>();
|
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount1), 11);
|
||||||
if (isChecked) {
|
|
||||||
StandaloneBadgeCount1 = 11;
|
public static readonly StyledProperty<double> StandaloneBadgeCount2Property =
|
||||||
StandaloneBadgeCount2 = 25;
|
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount2), 25);
|
||||||
StandaloneBadgeCount3 = 109;
|
|
||||||
} else {
|
public static readonly StyledProperty<double> StandaloneBadgeCount3Property =
|
||||||
StandaloneBadgeCount1 = 0;
|
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(StandaloneBadgeCount3), 109);
|
||||||
StandaloneBadgeCount2 = 0;
|
|
||||||
StandaloneBadgeCount3 = 0;
|
public BadgeShowCase()
|
||||||
}
|
{
|
||||||
}
|
DataContext = this;
|
||||||
}
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public double DynamicBadgeCount
|
||||||
|
{
|
||||||
|
get => GetValue(DynamicBadgeCountProperty);
|
||||||
|
set => SetValue(DynamicBadgeCountProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool DynamicDotBadgeVisible
|
||||||
|
{
|
||||||
|
get => GetValue(DynamicDotBadgeVisibleProperty);
|
||||||
|
set => SetValue(DynamicDotBadgeVisibleProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool StandaloneSwitchChecked
|
||||||
|
{
|
||||||
|
get => GetValue(StandaloneSwitchCheckedProperty);
|
||||||
|
set => SetValue(StandaloneSwitchCheckedProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double StandaloneBadgeCount1
|
||||||
|
{
|
||||||
|
get => GetValue(StandaloneBadgeCount1Property);
|
||||||
|
set => SetValue(StandaloneBadgeCount1Property, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double StandaloneBadgeCount2
|
||||||
|
{
|
||||||
|
get => GetValue(StandaloneBadgeCount2Property);
|
||||||
|
set => SetValue(StandaloneBadgeCount2Property, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double StandaloneBadgeCount3
|
||||||
|
{
|
||||||
|
get => GetValue(StandaloneBadgeCount3Property);
|
||||||
|
set => SetValue(StandaloneBadgeCount3Property, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddDynamicBadgeCount()
|
||||||
|
{
|
||||||
|
DynamicBadgeCount += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SubDynamicBadgeCount()
|
||||||
|
{
|
||||||
|
var value = DynamicBadgeCount;
|
||||||
|
value -= 1;
|
||||||
|
value = Math.Max(value, 0);
|
||||||
|
DynamicBadgeCount = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RandomDynamicBadgeCount()
|
||||||
|
{
|
||||||
|
var random = new Random();
|
||||||
|
DynamicBadgeCount = random.Next(0, 110);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs args)
|
||||||
|
{
|
||||||
|
base.OnPropertyChanged(args);
|
||||||
|
if (args.Property == StandaloneSwitchCheckedProperty)
|
||||||
|
{
|
||||||
|
var isChecked = args.GetNewValue<bool>();
|
||||||
|
if (isChecked)
|
||||||
|
{
|
||||||
|
StandaloneBadgeCount1 = 11;
|
||||||
|
StandaloneBadgeCount2 = 25;
|
||||||
|
StandaloneBadgeCount3 = 109;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
StandaloneBadgeCount1 = 0;
|
||||||
|
StandaloneBadgeCount2 = 0;
|
||||||
|
StandaloneBadgeCount3 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCasePanel.Styles>
|
<desktop:ShowCasePanel.Styles>
|
||||||
@ -13,7 +12,8 @@
|
|||||||
<Setter Property="Margin" Value="5" />
|
<Setter Property="Margin" Value="5" />
|
||||||
</Style>
|
</Style>
|
||||||
</desktop:ShowCasePanel.Styles>
|
</desktop:ShowCasePanel.Styles>
|
||||||
<desktop:ShowCaseItem Title="Type" Description="There are primary button, default button, dashed button, text button and link button in antd.">
|
<desktop:ShowCaseItem Title="Type"
|
||||||
|
Description="There are primary button, default button, dashed button, text button and link button in antd.">
|
||||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<atom:Button ButtonType="Primary">Primary Button</atom:Button>
|
<atom:Button ButtonType="Primary">Primary Button</atom:Button>
|
||||||
<atom:Button>Default Button</atom:Button>
|
<atom:Button>Default Button</atom:Button>
|
||||||
@ -22,7 +22,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Button Shape" Description="Supported button shape display, such as primary, default, dashed and Text, etc.">
|
<desktop:ShowCaseItem Title="Button Shape"
|
||||||
|
Description="Supported button shape display, such as primary, default, dashed and Text, etc.">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<WrapPanel Margin="0,0,0,20"
|
<WrapPanel Margin="0,0,0,20"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
@ -53,7 +54,8 @@
|
|||||||
|
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="AtomUI supports three sizes of buttons: small, default and large. If a large or small button is desired, set the size property to either large or small respectively. Omit the size property for a button with the default size.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="AtomUI supports three sizes of buttons: small, default and large. If a large or small button is desired, set the size property to either large or small respectively. Omit the size property for a button with the default size.">
|
||||||
<DockPanel Margin="0,0,0,0">
|
<DockPanel Margin="0,0,0,0">
|
||||||
<StackPanel DockPanel.Dock="Top"
|
<StackPanel DockPanel.Dock="Top"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
@ -104,7 +106,8 @@
|
|||||||
</DockPanel>
|
</DockPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Icon" Description="You can add an icon through the icon property and adjust the position of the icon using iconPosition.">
|
<desktop:ShowCaseItem Title="Icon"
|
||||||
|
Description="You can add an icon through the icon property and adjust the position of the icon using iconPosition.">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<atom:Button ButtonType="Primary"
|
<atom:Button ButtonType="Primary"
|
||||||
@ -170,7 +173,8 @@
|
|||||||
|
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Loading" Description="A loading indicator can be added to a button by setting the loading property on the Button.">
|
<desktop:ShowCaseItem Title="Loading"
|
||||||
|
Description="A loading indicator can be added to a button by setting the loading property on the Button.">
|
||||||
<StackPanel Margin="10"
|
<StackPanel Margin="10"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
@ -200,7 +204,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Block Button" Description="block property will make the button fit to its parent width.">
|
<desktop:ShowCaseItem Title="Block Button"
|
||||||
|
Description="block property will make the button fit to its parent width.">
|
||||||
<StackPanel Margin="10"
|
<StackPanel Margin="10"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
Orientation="Vertical">
|
Orientation="Vertical">
|
||||||
@ -236,7 +241,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Ghost Button" Description="ghost property will make button's background transparent, it is commonly used in colored background.">
|
<desktop:ShowCaseItem Title="Ghost Button"
|
||||||
|
Description="ghost property will make button's background transparent, it is commonly used in colored background.">
|
||||||
<Border Margin="10"
|
<Border Margin="10"
|
||||||
Padding="10"
|
Padding="10"
|
||||||
Background="rgb(190, 200, 200)">
|
Background="rgb(190, 200, 200)">
|
||||||
@ -292,7 +298,8 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Disabled" Description="To mark a button as disabled, add the disabled property to the Button.">
|
<desktop:ShowCaseItem Title="Disabled"
|
||||||
|
Description="To mark a button as disabled, add the disabled property to the Button.">
|
||||||
<WrapPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
<WrapPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<atom:Button ButtonType="Primary">
|
<atom:Button ButtonType="Primary">
|
||||||
|
@ -9,46 +9,46 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ButtonShowCase : UserControl
|
public partial class ButtonShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<SizeType> ButtonSizeTypeProperty =
|
public static readonly StyledProperty<SizeType> ButtonSizeTypeProperty =
|
||||||
AvaloniaProperty.Register<ButtonShowCase, SizeType>(nameof(ButtonSizeType), SizeType.Large);
|
AvaloniaProperty.Register<ButtonShowCase, SizeType>(nameof(ButtonSizeType));
|
||||||
|
|
||||||
public SizeType ButtonSizeType
|
|
||||||
{
|
|
||||||
get => GetValue(ButtonSizeTypeProperty);
|
|
||||||
set => SetValue(ButtonSizeTypeProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ButtonShowCase()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
DataContext = this;
|
|
||||||
|
|
||||||
ButtonSizeTypeOptionGroup.OptionCheckedChanged += HandleButtonSizeTypeOptionCheckedChanged;
|
|
||||||
LoadingBtn1.Click += HandleLoadingBtnClick;
|
|
||||||
LoadingBtn2.Click += HandleLoadingBtnClick;
|
|
||||||
LoadingBtn3.Click += HandleLoadingBtnClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleButtonSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Index == 0) {
|
|
||||||
ButtonSizeType = SizeType.Large;
|
|
||||||
} else if (args.Index == 1) {
|
|
||||||
ButtonSizeType = SizeType.Middle;
|
|
||||||
} else {
|
|
||||||
ButtonSizeType = SizeType.Small;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleLoadingBtnClick(object? sender, RoutedEventArgs args)
|
public ButtonShowCase()
|
||||||
{
|
{
|
||||||
if (sender is Button button) {
|
InitializeComponent();
|
||||||
button.IsLoading = true;
|
DataContext = this;
|
||||||
Dispatcher.UIThread.InvokeAsync(async () =>
|
|
||||||
{
|
ButtonSizeTypeOptionGroup.OptionCheckedChanged += HandleButtonSizeTypeOptionCheckedChanged;
|
||||||
await Task.Delay(TimeSpan.FromSeconds(3));
|
LoadingBtn1.Click += HandleLoadingBtnClick;
|
||||||
button.IsLoading = false;
|
LoadingBtn2.Click += HandleLoadingBtnClick;
|
||||||
});
|
LoadingBtn3.Click += HandleLoadingBtnClick;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public SizeType ButtonSizeType
|
||||||
|
{
|
||||||
|
get => GetValue(ButtonSizeTypeProperty);
|
||||||
|
set => SetValue(ButtonSizeTypeProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleButtonSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
ButtonSizeType = SizeType.Large;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
ButtonSizeType = SizeType.Middle;
|
||||||
|
else
|
||||||
|
ButtonSizeType = SizeType.Small;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleLoadingBtnClick(object? sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
if (sender is Button button)
|
||||||
|
{
|
||||||
|
button.IsLoading = true;
|
||||||
|
Dispatcher.UIThread.InvokeAsync(async () =>
|
||||||
|
{
|
||||||
|
await Task.Delay(TimeSpan.FromSeconds(3));
|
||||||
|
button.IsLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Basic button spinner.">
|
<desktop:ShowCaseItem Title="Basic" Description="Basic button spinner.">
|
||||||
@ -16,7 +15,8 @@
|
|||||||
</atom:ButtonSpinner>
|
</atom:ButtonSpinner>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three sizes of Input" Description="There are three sizes of an button spinner: large (40px), default (32px) and small (24px).">
|
<desktop:ShowCaseItem Title="Three sizes of Input"
|
||||||
|
Description="There are three sizes of an button spinner: large (40px), default (32px) and small (24px).">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -130,7 +130,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Status" Description="Add status to Input with status, which could be error or warning.">
|
<desktop:ShowCaseItem Title="Status"
|
||||||
|
Description="Add status to Input with status, which could be error or warning.">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -4,39 +4,35 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ButtonSpinnerShowCase : UserControl
|
public partial class ButtonSpinnerShowCase : UserControl
|
||||||
{
|
{
|
||||||
public ButtonSpinnerShowCase()
|
private readonly string[] _spinnerItems =
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
"床前明月光",
|
||||||
}
|
"疑是地上霜",
|
||||||
|
"举头望明月",
|
||||||
public void HandleSpin(object sender, SpinEventArgs e)
|
"低头思故乡"
|
||||||
{
|
};
|
||||||
var spinner = (ButtonSpinner)sender;
|
|
||||||
|
|
||||||
if (spinner.Content is TextBlock textBlock)
|
public ButtonSpinnerShowCase()
|
||||||
{
|
{
|
||||||
int value = Array.IndexOf(_spinnerItems, textBlock.Text);
|
InitializeComponent();
|
||||||
if (e.Direction == SpinDirection.Increase) {
|
}
|
||||||
value++;
|
|
||||||
} else {
|
|
||||||
value--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (value < 0) {
|
public void HandleSpin(object sender, SpinEventArgs e)
|
||||||
value = _spinnerItems.Length - 1;
|
{
|
||||||
} else if (value >= _spinnerItems.Length) {
|
var spinner = (ButtonSpinner)sender;
|
||||||
value = 0;
|
|
||||||
}
|
|
||||||
textBlock.Text = _spinnerItems[value];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
if (spinner.Content is TextBlock textBlock)
|
||||||
|
{
|
||||||
private readonly string[] _spinnerItems = new[]
|
var value = Array.IndexOf(_spinnerItems, textBlock.Text);
|
||||||
{
|
if (e.Direction == SpinDirection.Increase)
|
||||||
"床前明月光",
|
value++;
|
||||||
"疑是地上霜",
|
else
|
||||||
"举头望明月",
|
value--;
|
||||||
"低头思故乡"
|
|
||||||
};
|
if (value < 0)
|
||||||
|
value = _spinnerItems.Length - 1;
|
||||||
|
else if (value >= _spinnerItems.Length) value = 0;
|
||||||
|
textBlock.Text = _spinnerItems[value];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.CardShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.CardShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class CardShowCase : UserControl
|
public partial class CardShowCase : UserControl
|
||||||
{
|
{
|
||||||
public CardShowCase()
|
public CardShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCasePanel.Styles>
|
<desktop:ShowCasePanel.Styles>
|
||||||
@ -79,7 +78,8 @@
|
|||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Check all" Description="The indeterminate property can help you to achieve a 'check all' effect.">
|
<desktop:ShowCaseItem Title="Check all"
|
||||||
|
Description="The indeterminate property can help you to achieve a 'check all' effect.">
|
||||||
<StackPanel HorizontalAlignment="Left"
|
<StackPanel HorizontalAlignment="Left"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -111,7 +111,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Use with Grid" Description="We can use Checkbox and Grid in Checkbox.Group, to implement complex layout.">
|
<desktop:ShowCaseItem Title="Use with Grid"
|
||||||
|
Description="We can use Checkbox and Grid in Checkbox.Group, to implement complex layout.">
|
||||||
<Grid Margin="10"
|
<Grid Margin="10"
|
||||||
ColumnDefinitions="*,*,*"
|
ColumnDefinitions="*,*,*"
|
||||||
RowDefinitions="Auto,Auto,Auto">
|
RowDefinitions="Auto,Auto,Auto">
|
||||||
|
@ -5,9 +5,9 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class CheckBoxShowCase : UserControl
|
public partial class CheckBoxShowCase : UserControl
|
||||||
{
|
{
|
||||||
public CheckBoxShowCase()
|
public CheckBoxShowCase()
|
||||||
{
|
{
|
||||||
DataContext = new CheckBoxShowCaseModel();
|
DataContext = new CheckBoxShowCaseModel();
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Collapse" Description="By default, any number of panels can be expanded at a time. The first panel is expanded in this example.">
|
<desktop:ShowCaseItem Title="Collapse"
|
||||||
|
Description="By default, any number of panels can be expanded at a time. The first panel is expanded in this example.">
|
||||||
<atom:Collapse>
|
<atom:Collapse>
|
||||||
<atom:CollapseItem Header="This is panel header 1">
|
<atom:CollapseItem Header="This is panel header 1">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
@ -28,7 +28,8 @@
|
|||||||
</atom:Collapse>
|
</atom:Collapse>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="Ant Design supports a default collapse size as well as a large and small size. If a large or small collapse is desired, set the size property to either large or small respectively. Omit the size property for a collapse with the default size.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="Ant Design supports a default collapse size as well as a large and small size. If a large or small collapse is desired, set the size property to either large or small respectively. Omit the size property for a collapse with the default size.">
|
||||||
<StackPanel Margin="0,0,10,0"
|
<StackPanel Margin="0,0,10,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="20">
|
Spacing="20">
|
||||||
@ -65,7 +66,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Accordion" Description="In accordion mode, only one panel can be expanded at a time.">
|
<desktop:ShowCaseItem Title="Accordion"
|
||||||
|
Description="In accordion mode, only one panel can be expanded at a time.">
|
||||||
<atom:Collapse IsAccordion="True">
|
<atom:Collapse IsAccordion="True">
|
||||||
<atom:CollapseItem Header="This is panel header 1">
|
<atom:CollapseItem Header="This is panel header 1">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
@ -155,17 +157,20 @@
|
|||||||
Description="Render extra element in the top-right corner of each panel.">
|
Description="Render extra element in the top-right corner of each panel.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:Collapse ExpandIconPosition="{Binding CollapseExpandIconPosition}">
|
<atom:Collapse ExpandIconPosition="{Binding CollapseExpandIconPosition}">
|
||||||
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}" Header="This is panel header 1">
|
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}"
|
||||||
|
Header="This is panel header 1">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</atom:CollapseItem>
|
</atom:CollapseItem>
|
||||||
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}" Header="This is panel header 2">
|
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}"
|
||||||
|
Header="This is panel header 2">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
</atom:CollapseItem>
|
</atom:CollapseItem>
|
||||||
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}" Header="This is panel header 3">
|
<atom:CollapseItem AddOnContent="{atom:IconProvider Kind=SettingOutlined}"
|
||||||
|
Header="This is panel header 3">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.
|
||||||
</TextBlock>
|
</TextBlock>
|
||||||
|
@ -6,28 +6,27 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class CollapseShowCase : UserControl
|
public partial class CollapseShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<CollapseExpandIconPosition> CollapseExpandIconPositionProperty =
|
public static readonly StyledProperty<CollapseExpandIconPosition> CollapseExpandIconPositionProperty =
|
||||||
AvaloniaProperty.Register<CollapseShowCase, CollapseExpandIconPosition>(nameof(CollapseExpandIconPosition), CollapseExpandIconPosition.Start);
|
AvaloniaProperty.Register<CollapseShowCase, CollapseExpandIconPosition>(nameof(CollapseExpandIconPosition));
|
||||||
|
|
||||||
public CollapseExpandIconPosition CollapseExpandIconPosition
|
public CollapseShowCase()
|
||||||
{
|
{
|
||||||
get => GetValue(CollapseExpandIconPositionProperty);
|
InitializeComponent();
|
||||||
set => SetValue(CollapseExpandIconPositionProperty, value);
|
DataContext = this;
|
||||||
}
|
|
||||||
|
//ExpandButtonPosGroup.OptionCheckedChanged += HandleExpandButtonPosOptionCheckedChanged;
|
||||||
public CollapseShowCase()
|
}
|
||||||
{
|
|
||||||
InitializeComponent();
|
public CollapseExpandIconPosition CollapseExpandIconPosition
|
||||||
DataContext = this;
|
{
|
||||||
//ExpandButtonPosGroup.OptionCheckedChanged += HandleExpandButtonPosOptionCheckedChanged;
|
get => GetValue(CollapseExpandIconPositionProperty);
|
||||||
}
|
set => SetValue(CollapseExpandIconPositionProperty, value);
|
||||||
|
}
|
||||||
private void HandleExpandButtonPosOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
|
||||||
{
|
private void HandleExpandButtonPosOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
if (args.Index == 0) {
|
{
|
||||||
CollapseExpandIconPosition = CollapseExpandIconPosition.Start;
|
if (args.Index == 0)
|
||||||
} else if (args.Index == 1) {
|
CollapseExpandIconPosition = CollapseExpandIconPosition.Start;
|
||||||
CollapseExpandIconPosition = CollapseExpandIconPosition.End;
|
else if (args.Index == 1) CollapseExpandIconPosition = CollapseExpandIconPosition.End;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Basic button spinner.">
|
<desktop:ShowCaseItem Title="Basic" Description="Basic button spinner.">
|
||||||
@ -19,7 +18,8 @@
|
|||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three sizes of Input" Description="There are three sizes of an ComboBox: large (40px), default (32px) and small (24px).">
|
<desktop:ShowCaseItem Title="Three sizes of Input"
|
||||||
|
Description="There are three sizes of an ComboBox: large (40px), default (32px) and small (24px).">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -148,7 +148,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Status" Description="Add status to Input with status, which could be error or warning.">
|
<desktop:ShowCaseItem Title="Status"
|
||||||
|
Description="Add status to Input with status, which could be error or warning.">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ComboBoxShowCase : UserControl
|
public partial class ComboBoxShowCase : UserControl
|
||||||
{
|
{
|
||||||
public ComboBoxShowCase()
|
public ComboBoxShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class DatePickerShowCase : UserControl
|
public partial class DatePickerShowCase : UserControl
|
||||||
{
|
{
|
||||||
public DatePickerShowCase()
|
public DatePickerShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.DatePickerShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.DatePickerShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
xmlns:utils="clr-namespace:AtomUI.Demo.Desktop.Utils"
|
xmlns:utils="clr-namespace:AtomUI.Demo.Desktop.Utils"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
@ -51,7 +50,8 @@
|
|||||||
<desktop:ShowCaseItem Title="Basic" Description="Basic drawer.">
|
<desktop:ShowCaseItem Title="Basic" Description="Basic drawer.">
|
||||||
<Panel>
|
<Panel>
|
||||||
<atom:ToggleSwitch x:Name="OpenButton01" Content="Open" />
|
<atom:ToggleSwitch x:Name="OpenButton01" Content="Open" />
|
||||||
<atom:Drawer IsOpen="{Binding $parent[Panel].((atom:ToggleSwitch)Children[0]).IsChecked}" OpenOn="{Binding $parent[TopLevel]}">
|
<atom:Drawer IsOpen="{Binding $parent[Panel].((atom:ToggleSwitch)Children[0]).IsChecked}"
|
||||||
|
OpenOn="{Binding $parent[TopLevel]}">
|
||||||
<TextBlock Margin="50" Text="Some contents..." />
|
<TextBlock Margin="50" Text="Some contents..." />
|
||||||
</atom:Drawer>
|
</atom:Drawer>
|
||||||
</Panel>
|
</Panel>
|
||||||
@ -66,15 +66,17 @@
|
|||||||
<atom:ToggleSwitch Content="Open" />
|
<atom:ToggleSwitch Content="Open" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<atom:Drawer IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
<atom:Drawer
|
||||||
OpenOn="{Binding $parent[TopLevel]}"
|
IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
||||||
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
OpenOn="{Binding $parent[TopLevel]}"
|
||||||
|
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
||||||
<TextBlock Margin="50" Text="Some contents..." />
|
<TextBlock Margin="50" Text="Some contents..." />
|
||||||
</atom:Drawer>
|
</atom:Drawer>
|
||||||
</Panel>
|
</Panel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Extra Actions" Description="Extra actions should be placed at corner of drawer in Ant Design, you can use extra prop for that.">
|
<desktop:ShowCaseItem Title="Extra Actions"
|
||||||
|
Description="Extra actions should be placed at corner of drawer in Ant Design, you can use extra prop for that.">
|
||||||
<Panel>
|
<Panel>
|
||||||
<StackPanel Classes="ControllerPanel">
|
<StackPanel Classes="ControllerPanel">
|
||||||
<ListBox Classes="PlacementList"
|
<ListBox Classes="PlacementList"
|
||||||
@ -83,9 +85,10 @@
|
|||||||
<atom:ToggleSwitch Content="Open" />
|
<atom:ToggleSwitch Content="Open" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<atom:Drawer IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
<atom:Drawer
|
||||||
OpenOn="{Binding $parent[TopLevel]}"
|
IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
||||||
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
OpenOn="{Binding $parent[TopLevel]}"
|
||||||
|
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
||||||
<TextBlock Margin="50" Text=" TODO " />
|
<TextBlock Margin="50" Text=" TODO " />
|
||||||
</atom:Drawer>
|
</atom:Drawer>
|
||||||
</Panel>
|
</Panel>
|
||||||
@ -102,9 +105,10 @@
|
|||||||
<atom:ToggleSwitch Content="Open" />
|
<atom:ToggleSwitch Content="Open" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<atom:Drawer IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
<atom:Drawer
|
||||||
OpenOn="{Binding $parent[desktop:ShowCaseItem]}"
|
IsOpen="{Binding $parent[Panel].((Panel)Children[0]).((atom:ToggleSwitch)Children[1]).IsChecked}"
|
||||||
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
OpenOn="{Binding $parent[desktop:ShowCaseItem]}"
|
||||||
|
Placement="{Binding $parent[Panel].((Panel)Children[0]).((ListBox)Children[0]).SelectedItem}">
|
||||||
<TextBlock Margin="50" Text=" Some contents... " />
|
<TextBlock Margin="50" Text=" Some contents... " />
|
||||||
</atom:Drawer>
|
</atom:Drawer>
|
||||||
</Panel>
|
</Panel>
|
||||||
|
@ -8,28 +8,22 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class DrawerShowCase : UserControl
|
public partial class DrawerShowCase : UserControl
|
||||||
{
|
{
|
||||||
public DrawerShowCase()
|
public DrawerShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Button_OnClick(object? sender, RoutedEventArgs e)
|
private void Button_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is not Button button)
|
if (sender is not Button button) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Drawer.GetDrawer(button) is not { } drawer)
|
if (Drawer.GetDrawer(button) is not { } drawer) return;
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
drawer.IsOpen = false;
|
drawer.IsOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ButtonOpenOnCurrentParent_OnClick(object? sender, RoutedEventArgs e)
|
private void ButtonOpenOnCurrentParent_OnClick(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Drawer1.OpenOn = Drawer1.OpenOn?.Parent as Visual;
|
Drawer1.OpenOn = Drawer1.OpenOn?.Parent as Visual;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The most basic dropdown menu.">
|
<desktop:ShowCaseItem Title="Basic" Description="The most basic dropdown menu.">
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class DropdownButtonShowCase : UserControl
|
public partial class DropdownButtonShowCase : UserControl
|
||||||
{
|
{
|
||||||
public DropdownButtonShowCase()
|
public DropdownButtonShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,14 +5,14 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Simplest Usage.">
|
<desktop:ShowCaseItem Title="Basic" Description="Simplest Usage.">
|
||||||
<atom:EmptyIndicator PresetImage="Default" />
|
<atom:EmptyIndicator PresetImage="Default" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="AtomUI supports three sizes of buttons: small, default and large.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="AtomUI supports three sizes of buttons: small, default and large.">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<atom:EmptyIndicator PresetImage="Simple" SizeType="Small" />
|
<atom:EmptyIndicator PresetImage="Simple" SizeType="Small" />
|
||||||
@ -22,7 +22,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Customize" Description="Customize image source, image size, description and extra content.">
|
<desktop:ShowCaseItem Title="Customize"
|
||||||
|
Description="Customize image source, image size, description and extra content.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:EmptyIndicator Description="Customize Description"
|
<atom:EmptyIndicator Description="Customize Description"
|
||||||
ImagePath="avares://AtomUI.Demo.Desktop/Assets/EmptyShowCase/empty.svg"
|
ImagePath="avares://AtomUI.Demo.Desktop/Assets/EmptyShowCase/empty.svg"
|
||||||
@ -35,4 +36,4 @@
|
|||||||
<atom:EmptyIndicator IsShowDescription="False" PresetImage="Default" />
|
<atom:EmptyIndicator IsShowDescription="False" PresetImage="Default" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
</desktop:ShowCasePanel>
|
</desktop:ShowCasePanel>
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class EmptyShowCase : UserControl
|
public partial class EmptyShowCase : UserControl
|
||||||
{
|
{
|
||||||
public EmptyShowCase()
|
public EmptyShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Expander" Description="By default, The simplest usage is to expand downward.">
|
<desktop:ShowCaseItem Title="Expander" Description="By default, The simplest usage is to expand downward.">
|
||||||
@ -16,7 +15,8 @@
|
|||||||
</atom:Expander>
|
</atom:Expander>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="Ant Design supports a default Expander size as well as a large and small size. If a large or small Expander is desired, set the size property to either large or small respectively. Omit the size property for a Expander with the default size.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="Ant Design supports a default Expander size as well as a large and small size. If a large or small Expander is desired, set the size property to either large or small respectively. Omit the size property for a Expander with the default size.">
|
||||||
<StackPanel Margin="0,0,10,0"
|
<StackPanel Margin="0,0,10,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="20">
|
Spacing="20">
|
||||||
@ -47,7 +47,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Expanding Direction" Description="The content area supports expansion in four directions.">
|
<desktop:ShowCaseItem Title="Expanding Direction"
|
||||||
|
Description="The content area supports expansion in four directions.">
|
||||||
<DockPanel Height="300" Margin="0,0,0,0">
|
<DockPanel Height="300" Margin="0,0,0,0">
|
||||||
<StackPanel DockPanel.Dock="Top"
|
<StackPanel DockPanel.Dock="Top"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
|
@ -6,51 +6,47 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ExpanderShowCase : UserControl
|
public partial class ExpanderShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<ExpanderIconPosition> ToggleIconPositionProperty =
|
public static readonly StyledProperty<ExpanderIconPosition> ToggleIconPositionProperty =
|
||||||
AvaloniaProperty.Register<ExpanderShowCase, ExpanderIconPosition>(nameof(ToggleIconPosition), ExpanderIconPosition.Start);
|
AvaloniaProperty.Register<ExpanderShowCase, ExpanderIconPosition>(nameof(ToggleIconPosition));
|
||||||
|
|
||||||
public ExpanderIconPosition ToggleIconPosition
|
public static readonly StyledProperty<ExpandDirection> ExpandDirectionProperty =
|
||||||
{
|
AvaloniaProperty.Register<ExpanderShowCase, ExpandDirection>(nameof(ExpandDirection));
|
||||||
get => GetValue(ToggleIconPositionProperty);
|
|
||||||
set => SetValue(ToggleIconPositionProperty, value);
|
public ExpanderShowCase()
|
||||||
}
|
{
|
||||||
|
InitializeComponent();
|
||||||
public static readonly StyledProperty<ExpandDirection> ExpandDirectionProperty =
|
DataContext = this;
|
||||||
AvaloniaProperty.Register<ExpanderShowCase, ExpandDirection>(nameof(ExpandDirection), ExpandDirection.Down);
|
ExpandButtonPosGroup.OptionCheckedChanged += HandleExpandButtonPosOptionCheckedChanged;
|
||||||
|
ExpandDirectionOptionGroup.OptionCheckedChanged += HandleExpandDirectionOptionCheckedChanged;
|
||||||
public ExpandDirection ExpandDirection
|
}
|
||||||
{
|
|
||||||
get => GetValue(ExpandDirectionProperty);
|
public ExpanderIconPosition ToggleIconPosition
|
||||||
set => SetValue(ExpandDirectionProperty, value);
|
{
|
||||||
}
|
get => GetValue(ToggleIconPositionProperty);
|
||||||
|
set => SetValue(ToggleIconPositionProperty, value);
|
||||||
public ExpanderShowCase()
|
}
|
||||||
{
|
|
||||||
InitializeComponent();
|
public ExpandDirection ExpandDirection
|
||||||
DataContext = this;
|
{
|
||||||
ExpandButtonPosGroup.OptionCheckedChanged += HandleExpandButtonPosOptionCheckedChanged;
|
get => GetValue(ExpandDirectionProperty);
|
||||||
ExpandDirectionOptionGroup.OptionCheckedChanged += HandleExpandDirectionOptionCheckedChanged;
|
set => SetValue(ExpandDirectionProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleExpandButtonPosOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
private void HandleExpandButtonPosOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
{
|
{
|
||||||
if (args.Index == 0) {
|
if (args.Index == 0)
|
||||||
ToggleIconPosition = ExpanderIconPosition.Start;
|
ToggleIconPosition = ExpanderIconPosition.Start;
|
||||||
} else if (args.Index == 1) {
|
else if (args.Index == 1) ToggleIconPosition = ExpanderIconPosition.End;
|
||||||
ToggleIconPosition = ExpanderIconPosition.End;
|
}
|
||||||
}
|
|
||||||
}
|
private void HandleExpandDirectionOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
private void HandleExpandDirectionOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
if (args.Index == 0)
|
||||||
{
|
ExpandDirection = ExpandDirection.Down;
|
||||||
if (args.Index == 0) {
|
else if (args.Index == 1)
|
||||||
ExpandDirection = ExpandDirection.Down;
|
ExpandDirection = ExpandDirection.Up;
|
||||||
} else if (args.Index == 1) {
|
else if (args.Index == 2)
|
||||||
ExpandDirection = ExpandDirection.Up;
|
ExpandDirection = ExpandDirection.Left;
|
||||||
} else if (args.Index == 2) {
|
else if (args.Index == 3) ExpandDirection = ExpandDirection.Right;
|
||||||
ExpandDirection = ExpandDirection.Left;
|
}
|
||||||
} else if (args.Index == 3) {
|
|
||||||
ExpandDirection = ExpandDirection.Right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Basic usage of the GroupBox control.">
|
<desktop:ShowCaseItem Title="Basic" Description="Basic usage of the GroupBox control.">
|
||||||
@ -18,7 +17,8 @@
|
|||||||
</atom:GroupBox>
|
</atom:GroupBox>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Header title Position" Description="GroupBox Header supports three position types: Left, Center and Right.">
|
<desktop:ShowCaseItem Title="Header title Position"
|
||||||
|
Description="GroupBox Header supports three position types: Left, Center and Right.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:GroupBox HeaderTitle="Title Info">
|
<atom:GroupBox HeaderTitle="Title Info">
|
||||||
<Panel Height="40">
|
<Panel Height="40">
|
||||||
@ -44,7 +44,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Header title style" Description="GroupBox Header supports customizing some properties of color and font.">
|
<desktop:ShowCaseItem Title="Header title style"
|
||||||
|
Description="GroupBox Header supports customizing some properties of color and font.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:GroupBox HeaderFontStyle="Italic" HeaderTitle="Title Info">
|
<atom:GroupBox HeaderFontStyle="Italic" HeaderTitle="Title Info">
|
||||||
<Panel Height="40">
|
<Panel Height="40">
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class GroupBoxShowCase : UserControl
|
public partial class GroupBoxShowCase : UserControl
|
||||||
{
|
{
|
||||||
public GroupBoxShowCase()
|
public GroupBoxShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,25 +1,22 @@
|
|||||||
|
using AtomUI.Demo.Desktop.ViewModels;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using AtomUI.Demo.Desktop.ViewModels;
|
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||||
|
|
||||||
public partial class IconShowCase : UserControl
|
public partial class IconShowCase : UserControl
|
||||||
{
|
{
|
||||||
public IconShowCase()
|
public IconShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
PaletteDemoViewModel vm = new PaletteDemoViewModel();
|
var vm = new PaletteDemoViewModel();
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() => { vm.InitializeResources(); });
|
||||||
{
|
DataContext = vm;
|
||||||
vm.InitializeResources();
|
}
|
||||||
});
|
|
||||||
DataContext = vm;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The most basic example. The size of the floating layer depends on the contents region.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="The most basic example. The size of the floating layer depends on the contents region.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:FlyoutHost Trigger="Hover">
|
<atom:FlyoutHost Trigger="Hover">
|
||||||
<atom:FlyoutHost.Flyout>
|
<atom:FlyoutHost.Flyout>
|
||||||
|
@ -6,44 +6,49 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class InfoFlyoutShowCase : UserControl
|
public partial class InfoFlyoutShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<bool> ShowArrowProperty =
|
public static readonly StyledProperty<bool> ShowArrowProperty =
|
||||||
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(ShowArrow), true);
|
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(ShowArrow), true);
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> IsPointAtCenterProperty =
|
|
||||||
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(IsPointAtCenter), false);
|
|
||||||
|
|
||||||
private Segmented _segmented;
|
public static readonly StyledProperty<bool> IsPointAtCenterProperty =
|
||||||
|
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(IsPointAtCenter));
|
||||||
public bool ShowArrow
|
|
||||||
{
|
private readonly Segmented _segmented;
|
||||||
get => GetValue(ShowArrowProperty);
|
|
||||||
set => SetValue(ShowArrowProperty, value);
|
public InfoFlyoutShowCase()
|
||||||
}
|
{
|
||||||
|
DataContext = this;
|
||||||
public bool IsPointAtCenter
|
InitializeComponent();
|
||||||
{
|
var control = this as Control;
|
||||||
get => GetValue(IsPointAtCenterProperty);
|
_segmented = control.FindControl<Segmented>("ArrowSegmented")!;
|
||||||
set => SetValue(IsPointAtCenterProperty, value);
|
_segmented.SelectionChanged += (sender, args) =>
|
||||||
}
|
{
|
||||||
|
if (_segmented.SelectedIndex == 0)
|
||||||
public InfoFlyoutShowCase()
|
{
|
||||||
{
|
ShowArrow = true;
|
||||||
DataContext = this;
|
IsPointAtCenter = false;
|
||||||
InitializeComponent();
|
}
|
||||||
var control = this as Control;
|
else if (_segmented.SelectedIndex == 1)
|
||||||
_segmented = control.FindControl<Segmented>("ArrowSegmented")!;
|
{
|
||||||
_segmented.SelectionChanged += (sender, args) =>
|
ShowArrow = false;
|
||||||
{
|
IsPointAtCenter = false;
|
||||||
if (_segmented.SelectedIndex == 0) {
|
}
|
||||||
ShowArrow = true;
|
else if (_segmented.SelectedIndex == 2)
|
||||||
IsPointAtCenter = false;
|
{
|
||||||
} else if (_segmented.SelectedIndex == 1) {
|
IsPointAtCenter = true;
|
||||||
ShowArrow = false;
|
ShowArrow = true;
|
||||||
IsPointAtCenter = false;
|
}
|
||||||
} else if (_segmented.SelectedIndex == 2) {
|
};
|
||||||
IsPointAtCenter = true;
|
}
|
||||||
ShowArrow = true;
|
|
||||||
}
|
public bool ShowArrow
|
||||||
};
|
{
|
||||||
}
|
get => GetValue(ShowArrowProperty);
|
||||||
|
set => SetValue(ShowArrowProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsPointAtCenter
|
||||||
|
{
|
||||||
|
get => GetValue(IsPointAtCenterProperty);
|
||||||
|
set => SetValue(IsPointAtCenterProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,14 +5,14 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic usage" Description="Basic usage example.">
|
<desktop:ShowCaseItem Title="Basic usage" Description="Basic usage example.">
|
||||||
<atom:LineEdit Watermark="Basic usage" />
|
<atom:LineEdit Watermark="Basic usage" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three sizes of Input" Description="There are three sizes of an Input box: large (40px), default (32px) and small (24px).">
|
<desktop:ShowCaseItem Title="Three sizes of Input"
|
||||||
|
Description="There are three sizes of an Input box: large (40px), default (32px) and small (24px).">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -55,7 +55,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="With clear icon" Description="Input box with the remove icon, click the icon to delete everything.">
|
<desktop:ShowCaseItem Title="With clear icon"
|
||||||
|
Description="Input box with the remove icon, click the icon to delete everything.">
|
||||||
<atom:LineEdit Width="400"
|
<atom:LineEdit Width="400"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsEnableClearButton="True"
|
IsEnableClearButton="True"
|
||||||
@ -82,11 +83,12 @@
|
|||||||
|
|
||||||
<desktop:ShowCaseItem Title="prefix and suffix" Description="Add a prefix or suffix icons inside input.">
|
<desktop:ShowCaseItem Title="prefix and suffix" Description="Add a prefix or suffix icons inside input.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:LineEdit InnerLeftContent="{atom:IconProvider Kind=UserOutlined,
|
<atom:LineEdit
|
||||||
|
InnerLeftContent="{atom:IconProvider Kind=UserOutlined,
|
||||||
NormalFilledColor=#D7D7D7}"
|
NormalFilledColor=#D7D7D7}"
|
||||||
InnerRightContent="{atom:IconProvider Kind=InfoCircleOutlined,
|
InnerRightContent="{atom:IconProvider Kind=InfoCircleOutlined,
|
||||||
NormalFilledColor=#8C8C8C}"
|
NormalFilledColor=#8C8C8C}"
|
||||||
Watermark="Enter your username" />
|
Watermark="Enter your username" />
|
||||||
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" />
|
<atom:LineEdit InnerLeftContent="¥" InnerRightContent="RMB" />
|
||||||
<atom:LineEdit InnerLeftContent="¥"
|
<atom:LineEdit InnerLeftContent="¥"
|
||||||
InnerRightContent="RMB"
|
InnerRightContent="RMB"
|
||||||
@ -94,7 +96,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Status" Description="Add status to Input with status, which could be error or warning.">
|
<desktop:ShowCaseItem Title="Status"
|
||||||
|
Description="Add status to Input with status, which could be error or warning.">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -127,7 +130,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Search box" Description="Example of creating a search box by grouping a standard input with a search button.">
|
<desktop:ShowCaseItem Title="Search box"
|
||||||
|
Description="Example of creating a search box by grouping a standard input with a search button.">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class LineEditShowCase : UserControl
|
public partial class LineEditShowCase : UserControl
|
||||||
{
|
{
|
||||||
public LineEditShowCase()
|
public LineEditShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic usage" Description="Basic usage example.">
|
<desktop:ShowCaseItem Title="Basic usage" Description="Basic usage example.">
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ListBoxShowCase : UserControl
|
public partial class ListBoxShowCase : UserControl
|
||||||
{
|
{
|
||||||
public ListBoxShowCase()
|
public ListBoxShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,14 +5,14 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic Usage" Description="A simple loading status.">
|
<desktop:ShowCaseItem Title="Basic Usage" Description="A simple loading status.">
|
||||||
<atom:LoadingIndicator />
|
<atom:LoadingIndicator />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="A small LoadingIndicator is used for loading text, default sized LoadingIndicator for loading a card-level block, and large LoadingIndicator used for loading a page.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="A small LoadingIndicator is used for loading text, default sized LoadingIndicator for loading a card-level block, and large LoadingIndicator used for loading a page.">
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<atom:LoadingIndicator VerticalAlignment="Center" SizeType="Small" />
|
<atom:LoadingIndicator VerticalAlignment="Center" SizeType="Small" />
|
||||||
<atom:LoadingIndicator VerticalAlignment="Center" SizeType="Middle" />
|
<atom:LoadingIndicator VerticalAlignment="Center" SizeType="Middle" />
|
||||||
|
@ -5,19 +5,18 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class LoadingIndicatorShowCase : UserControl
|
public partial class LoadingIndicatorShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<bool> IsLoadingSwitchCheckedProperty =
|
public static readonly StyledProperty<bool> IsLoadingSwitchCheckedProperty =
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(IsLoadingSwitchChecked), false);
|
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(IsLoadingSwitchChecked));
|
||||||
|
|
||||||
public bool IsLoadingSwitchChecked
|
public LoadingIndicatorShowCase()
|
||||||
{
|
{
|
||||||
get => GetValue(IsLoadingSwitchCheckedProperty);
|
DataContext = this;
|
||||||
set => SetValue(IsLoadingSwitchCheckedProperty, value);
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoadingIndicatorShowCase()
|
public bool IsLoadingSwitchChecked
|
||||||
{
|
{
|
||||||
DataContext = this;
|
get => GetValue(IsLoadingSwitchCheckedProperty);
|
||||||
InitializeComponent();
|
set => SetValue(IsLoadingSwitchCheckedProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Simplest Usage.">
|
<desktop:ShowCaseItem Title="Basic" Description="Simplest Usage.">
|
||||||
@ -59,7 +58,8 @@
|
|||||||
</atom:Menu>
|
</atom:Menu>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="menu item with ToggleType" Description="Renders a checkbox or radio button on a menu.">
|
<desktop:ShowCaseItem Title="menu item with ToggleType"
|
||||||
|
Description="Renders a checkbox or radio button on a menu.">
|
||||||
<atom:Menu>
|
<atom:Menu>
|
||||||
<atom:MenuItem Header="_Menu A">
|
<atom:MenuItem Header="_Menu A">
|
||||||
<atom:MenuItem GroupName="Group1"
|
<atom:MenuItem GroupName="Group1"
|
||||||
@ -93,7 +93,8 @@
|
|||||||
</atom:Menu>
|
</atom:Menu>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Scrollable menu" Description="When there are too many menu items, up and down scroll buttons will appear.">
|
<desktop:ShowCaseItem Title="Scrollable menu"
|
||||||
|
Description="When there are too many menu items, up and down scroll buttons will appear.">
|
||||||
<atom:Menu>
|
<atom:Menu>
|
||||||
<atom:MenuItem Header="_Menu">
|
<atom:MenuItem Header="_Menu">
|
||||||
<atom:MenuItem Header="Menu Item" />
|
<atom:MenuItem Header="Menu Item" />
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class MenuShowCase : UserControl
|
public partial class MenuShowCase : UserControl
|
||||||
{
|
{
|
||||||
public MenuShowCase()
|
public MenuShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage for Message.">
|
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage for Message.">
|
||||||
@ -14,7 +13,8 @@
|
|||||||
</atom:Button>
|
</atom:Button>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Other types of message" Description="Messages of success, error and warning types.">
|
<desktop:ShowCaseItem Title="Other types of message"
|
||||||
|
Description="Messages of success, error and warning types.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:Button ButtonType="Default" Click="ShowSuccessMessage">
|
<atom:Button ButtonType="Default" Click="ShowSuccessMessage">
|
||||||
Success
|
Success
|
||||||
@ -31,13 +31,15 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Message with loading indicator" Description="Display a global loading indicator, which is dismissed by itself asynchronously.">
|
<desktop:ShowCaseItem Title="Message with loading indicator"
|
||||||
|
Description="Display a global loading indicator, which is dismissed by itself asynchronously.">
|
||||||
<atom:Button ButtonType="Default" Click="ShowLoadingMessage">
|
<atom:Button ButtonType="Default" Click="ShowLoadingMessage">
|
||||||
Display a loading indicator
|
Display a loading indicator
|
||||||
</atom:Button>
|
</atom:Button>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Callback" Description="The above example will display a new message when the old message is about to close.">
|
<desktop:ShowCaseItem Title="Callback"
|
||||||
|
Description="The above example will display a new message when the old message is about to close.">
|
||||||
<atom:Button ButtonType="Default" Click="ShowSequentialMessage">
|
<atom:Button ButtonType="Default" Click="ShowSequentialMessage">
|
||||||
Display a loading indicator
|
Display a loading indicator
|
||||||
</atom:Button>
|
</atom:Button>
|
||||||
|
@ -7,92 +7,92 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class MessageShowCase : UserControl
|
public partial class MessageShowCase : UserControl
|
||||||
{
|
{
|
||||||
private WindowMessageManager? _messageManager;
|
private WindowMessageManager? _messageManager;
|
||||||
|
|
||||||
public MessageShowCase()
|
public MessageShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnAttachedToVisualTree(e);
|
base.OnAttachedToVisualTree(e);
|
||||||
var topLevel = TopLevel.GetTopLevel(this);
|
var topLevel = TopLevel.GetTopLevel(this);
|
||||||
_messageManager = new WindowMessageManager(topLevel)
|
_messageManager = new WindowMessageManager(topLevel)
|
||||||
{
|
{
|
||||||
MaxItems = 10
|
MaxItems = 10
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSimpleMessage(object? sender, RoutedEventArgs e)
|
private void ShowSimpleMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
content: "Hello, AtomUI/Avalonia!"
|
"Hello, AtomUI/Avalonia!"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowInfoMessage(object? sender, RoutedEventArgs e)
|
private void ShowInfoMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Information,
|
type: MessageType.Information,
|
||||||
content: "This is a information message."
|
content: "This is a information message."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSuccessMessage(object? sender, RoutedEventArgs e)
|
private void ShowSuccessMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Success,
|
type: MessageType.Success,
|
||||||
content: "This is a success message."
|
content: "This is a success message."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowWarningMessage(object? sender, RoutedEventArgs e)
|
private void ShowWarningMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Warning,
|
type: MessageType.Warning,
|
||||||
content: "This is a warning message."
|
content: "This is a warning message."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowErrorMessage(object? sender, RoutedEventArgs e)
|
private void ShowErrorMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Error,
|
type: MessageType.Error,
|
||||||
content: "This is a error message."
|
content: "This is a error message."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowLoadingMessage(object? sender, RoutedEventArgs e)
|
private void ShowLoadingMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Loading,
|
type: MessageType.Loading,
|
||||||
content: "Action in progress..."
|
content: "Action in progress..."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSequentialMessage(object? sender, RoutedEventArgs e)
|
private void ShowSequentialMessage(object? sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Loading,
|
type: MessageType.Loading,
|
||||||
content: "Action in progress...",
|
content: "Action in progress...",
|
||||||
expiration: TimeSpan.FromSeconds(2.5),
|
expiration: TimeSpan.FromSeconds(2.5),
|
||||||
onClose: () =>
|
onClose: () =>
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Success,
|
type: MessageType.Success,
|
||||||
expiration: TimeSpan.FromSeconds(2.5),
|
expiration: TimeSpan.FromSeconds(2.5),
|
||||||
content: "Loading finished",
|
content: "Loading finished",
|
||||||
onClose: () =>
|
onClose: () =>
|
||||||
{
|
{
|
||||||
_messageManager?.Show(new Message(
|
_messageManager?.Show(new Message(
|
||||||
type: MessageType.Information,
|
type: MessageType.Information,
|
||||||
expiration: TimeSpan.FromSeconds(2.5),
|
expiration: TimeSpan.FromSeconds(2.5),
|
||||||
content: "Loading finished"
|
content: "Loading finished"
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage for Notification.">
|
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage for Notification.">
|
||||||
@ -14,13 +13,15 @@
|
|||||||
</atom:Button>
|
</atom:Button>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Duration after which the notification box is closed" Description="Duration can be used to specify how long the notification stays open. After the duration time elapses, the notification closes automatically. If not specified, default value is 4.5 seconds. If you set the value to TimeSpan.Zero, the notification box will never close automatically.">
|
<desktop:ShowCaseItem Title="Duration after which the notification box is closed"
|
||||||
|
Description="Duration can be used to specify how long the notification stays open. After the duration time elapses, the notification closes automatically. If not specified, default value is 4.5 seconds. If you set the value to TimeSpan.Zero, the notification box will never close automatically.">
|
||||||
<atom:Button ButtonType="Primary" Click="ShowNeverCloseNotification">
|
<atom:Button ButtonType="Primary" Click="ShowNeverCloseNotification">
|
||||||
Open the notification box
|
Open the notification box
|
||||||
</atom:Button>
|
</atom:Button>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Notification with icon" Description="A notification box with a icon at the left side.">
|
<desktop:ShowCaseItem Title="Notification with icon"
|
||||||
|
Description="A notification box with a icon at the left side.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:Button ButtonType="Default" Click="ShowSuccessNotification">
|
<atom:Button ButtonType="Default" Click="ShowSuccessNotification">
|
||||||
Success
|
Success
|
||||||
@ -37,7 +38,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Placement" Description="A notification box can appear from the top bottom topLeft topRight bottomLeft or bottomRight of the viewport via placement.">
|
<desktop:ShowCaseItem Title="Placement"
|
||||||
|
Description="A notification box can appear from the top bottom topLeft topRight bottomLeft or bottomRight of the viewport via placement.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:Button ButtonType="Primary" Click="ShowTopNotification">
|
<atom:Button ButtonType="Primary" Click="ShowTopNotification">
|
||||||
|
@ -8,199 +8,204 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class NotificationShowCase : UserControl
|
public partial class NotificationShowCase : UserControl
|
||||||
{
|
{
|
||||||
private WindowNotificationManager? _basicManager;
|
private WindowNotificationManager? _basicManager;
|
||||||
private WindowNotificationManager? _topLeftManager;
|
|
||||||
private WindowNotificationManager? _topManager;
|
|
||||||
private WindowNotificationManager? _topRightManager;
|
|
||||||
|
|
||||||
private WindowNotificationManager? _bottomLeftManager;
|
|
||||||
private WindowNotificationManager? _bottomManager;
|
|
||||||
private WindowNotificationManager? _bottomRightManager;
|
|
||||||
|
|
||||||
public NotificationShowCase()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
HoverOptionGroup.OptionCheckedChanged += HandleHoverOptionGroupCheckedChanged;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleHoverOptionGroupCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
private WindowNotificationManager? _bottomLeftManager;
|
||||||
{
|
private WindowNotificationManager? _bottomManager;
|
||||||
if (_basicManager is not null) {
|
private WindowNotificationManager? _bottomRightManager;
|
||||||
if (args.Index == 0) {
|
private WindowNotificationManager? _topLeftManager;
|
||||||
_basicManager.IsPauseOnHover = true;
|
private WindowNotificationManager? _topManager;
|
||||||
} else {
|
private WindowNotificationManager? _topRightManager;
|
||||||
_basicManager.IsPauseOnHover = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnAttachedToVisualTree(e);
|
|
||||||
var topLevel = TopLevel.GetTopLevel(this);
|
|
||||||
_basicManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
_topLeftManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
MaxItems = 3,
|
|
||||||
Position = NotificationPosition.TopLeft
|
|
||||||
};
|
|
||||||
|
|
||||||
_topManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
Position = NotificationPosition.TopCenter,
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
_topRightManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
Position = NotificationPosition.TopRight,
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
_bottomLeftManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
Position = NotificationPosition.BottomLeft,
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
_bottomManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
Position = NotificationPosition.BottomCenter,
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
|
|
||||||
_bottomRightManager = new WindowNotificationManager(topLevel)
|
|
||||||
{
|
|
||||||
Position = NotificationPosition.BottomRight,
|
|
||||||
MaxItems = 3
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowSimpleNotification(object? sender, RoutedEventArgs e)
|
public NotificationShowCase()
|
||||||
{
|
{
|
||||||
_basicManager?.Show(new Notification(
|
InitializeComponent();
|
||||||
title: "Notification Title",
|
HoverOptionGroup.OptionCheckedChanged += HandleHoverOptionGroupCheckedChanged;
|
||||||
content: "Hello, AtomUI/Avalonia!"
|
}
|
||||||
));
|
|
||||||
}
|
private void HandleHoverOptionGroupCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
private void ShowNeverCloseNotification(object? sender, RoutedEventArgs e)
|
if (_basicManager is not null)
|
||||||
{
|
{
|
||||||
_basicManager?.Show(new Notification(
|
if (args.Index == 0)
|
||||||
expiration : TimeSpan.Zero,
|
_basicManager.IsPauseOnHover = true;
|
||||||
title : "Notification Title",
|
else
|
||||||
content : "I will never close automatically. This is a purposely very very long description that has many many characters and words."
|
_basicManager.IsPauseOnHover = false;
|
||||||
));
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ShowSuccessNotification(object? sender, RoutedEventArgs e)
|
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
|
||||||
{
|
{
|
||||||
_basicManager?.Show(new Notification(
|
base.OnAttachedToVisualTree(e);
|
||||||
type: NotificationType.Success,
|
var topLevel = TopLevel.GetTopLevel(this);
|
||||||
title: "Notification Title",
|
_basicManager = new WindowNotificationManager(topLevel)
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
{
|
||||||
));
|
MaxItems = 3
|
||||||
}
|
};
|
||||||
|
|
||||||
private void ShowInfoNotification(object? sender, RoutedEventArgs e)
|
_topLeftManager = new WindowNotificationManager(topLevel)
|
||||||
{
|
{
|
||||||
_basicManager?.Show(new Notification(
|
MaxItems = 3,
|
||||||
type: NotificationType.Information,
|
Position = NotificationPosition.TopLeft
|
||||||
title: "Notification Title",
|
};
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
|
||||||
));
|
_topManager = new WindowNotificationManager(topLevel)
|
||||||
}
|
{
|
||||||
|
Position = NotificationPosition.TopCenter,
|
||||||
private void ShowWarningNotification(object? sender, RoutedEventArgs e)
|
MaxItems = 3
|
||||||
{
|
};
|
||||||
_basicManager?.Show(new Notification(
|
|
||||||
type: NotificationType.Warning,
|
_topRightManager = new WindowNotificationManager(topLevel)
|
||||||
title: "Notification Title",
|
{
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
Position = NotificationPosition.TopRight,
|
||||||
));
|
MaxItems = 3
|
||||||
}
|
};
|
||||||
|
|
||||||
private void ShowErrorNotification(object? sender, RoutedEventArgs e)
|
_bottomLeftManager = new WindowNotificationManager(topLevel)
|
||||||
{
|
{
|
||||||
_basicManager?.Show(new Notification(
|
Position = NotificationPosition.BottomLeft,
|
||||||
type: NotificationType.Error,
|
MaxItems = 3
|
||||||
title: "Notification Title",
|
};
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
|
||||||
));
|
_bottomManager = new WindowNotificationManager(topLevel)
|
||||||
}
|
{
|
||||||
|
Position = NotificationPosition.BottomCenter,
|
||||||
private void ShowTopNotification(object? sender, RoutedEventArgs e)
|
MaxItems = 3
|
||||||
{
|
};
|
||||||
_topManager?.Show(new Notification(
|
|
||||||
title : "Notification Top",
|
_bottomRightManager = new WindowNotificationManager(topLevel)
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
{
|
||||||
));
|
Position = NotificationPosition.BottomRight,
|
||||||
}
|
MaxItems = 3
|
||||||
|
};
|
||||||
private void ShowBottomNotification(object? sender, RoutedEventArgs e)
|
}
|
||||||
{
|
|
||||||
_bottomManager?.Show(new Notification(
|
private void ShowSimpleNotification(object? sender, RoutedEventArgs e)
|
||||||
title : "Notification Bottom",
|
{
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
_basicManager?.Show(new Notification(
|
||||||
));
|
"Notification Title",
|
||||||
}
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
private void ShowTopLeftNotification(object? sender, RoutedEventArgs e)
|
}
|
||||||
{
|
|
||||||
_topLeftManager?.Show(new Notification(
|
private void ShowNeverCloseNotification(object? sender, RoutedEventArgs e)
|
||||||
title : "Notification TopLeft",
|
{
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
_basicManager?.Show(new Notification(
|
||||||
));
|
expiration: TimeSpan.Zero,
|
||||||
}
|
title: "Notification Title",
|
||||||
|
content:
|
||||||
private void ShowTopRightNotification(object? sender, RoutedEventArgs e)
|
"I will never close automatically. This is a purposely very very long description that has many many characters and words."
|
||||||
{
|
));
|
||||||
_topRightManager?.Show(new Notification(
|
}
|
||||||
title : "Notification TopRight",
|
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
private void ShowSuccessNotification(object? sender, RoutedEventArgs e)
|
||||||
));
|
{
|
||||||
}
|
_basicManager?.Show(new Notification(
|
||||||
|
type: NotificationType.Success,
|
||||||
private void ShowBottomLeftNotification(object? sender, RoutedEventArgs e)
|
title: "Notification Title",
|
||||||
{
|
content:
|
||||||
_bottomLeftManager?.Show(new Notification(
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
||||||
title : "Notification BottomLeft",
|
));
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
}
|
||||||
));
|
|
||||||
}
|
private void ShowInfoNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
private void ShowBottomRightNotification(object? sender, RoutedEventArgs e)
|
_basicManager?.Show(new Notification(
|
||||||
{
|
type: NotificationType.Information,
|
||||||
_bottomRightManager?.Show(new Notification(
|
title: "Notification Title",
|
||||||
title : "Notification BottomRight",
|
content:
|
||||||
content : "Hello, AtomUI/Avalonia!"
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ShowWarningNotification(object? sender, RoutedEventArgs e)
|
||||||
private void ShowCustomIconNotification(object? sender, RoutedEventArgs e)
|
{
|
||||||
{
|
_basicManager?.Show(new Notification(
|
||||||
_basicManager?.Show(new Notification(
|
type: NotificationType.Warning,
|
||||||
title: "Notification Title",
|
title: "Notification Title",
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification.",
|
content:
|
||||||
icon: new PathIcon()
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
||||||
{
|
));
|
||||||
Kind = "SettingOutlined"
|
}
|
||||||
}
|
|
||||||
));
|
private void ShowErrorNotification(object? sender, RoutedEventArgs e)
|
||||||
}
|
{
|
||||||
|
_basicManager?.Show(new Notification(
|
||||||
private void ShowProgressNotification(object? sender, RoutedEventArgs e)
|
type: NotificationType.Error,
|
||||||
{
|
title: "Notification Title",
|
||||||
_basicManager?.Show(new Notification(
|
content:
|
||||||
type: NotificationType.Information,
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification."
|
||||||
title: "Notification Title",
|
));
|
||||||
content: "This is the content of the notification. This is the content of the notification. This is the content of the notification.",
|
}
|
||||||
showProgress:true
|
|
||||||
));
|
private void ShowTopNotification(object? sender, RoutedEventArgs e)
|
||||||
}
|
{
|
||||||
|
_topManager?.Show(new Notification(
|
||||||
|
"Notification Top",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowBottomNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_bottomManager?.Show(new Notification(
|
||||||
|
"Notification Bottom",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowTopLeftNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_topLeftManager?.Show(new Notification(
|
||||||
|
"Notification TopLeft",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowTopRightNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_topRightManager?.Show(new Notification(
|
||||||
|
"Notification TopRight",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowBottomLeftNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_bottomLeftManager?.Show(new Notification(
|
||||||
|
"Notification BottomLeft",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowBottomRightNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_bottomRightManager?.Show(new Notification(
|
||||||
|
"Notification BottomRight",
|
||||||
|
"Hello, AtomUI/Avalonia!"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowCustomIconNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_basicManager?.Show(new Notification(
|
||||||
|
"Notification Title",
|
||||||
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification.",
|
||||||
|
icon: new PathIcon
|
||||||
|
{
|
||||||
|
Kind = "SettingOutlined"
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShowProgressNotification(object? sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
_basicManager?.Show(new Notification(
|
||||||
|
type: NotificationType.Information,
|
||||||
|
title: "Notification Title",
|
||||||
|
content:
|
||||||
|
"This is the content of the notification. This is the content of the notification. This is the content of the notification.",
|
||||||
|
showProgress: true
|
||||||
|
));
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,14 +5,14 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic usage" Description="Numeric-only NumberUpDown.">
|
<desktop:ShowCaseItem Title="Basic usage" Description="Numeric-only NumberUpDown.">
|
||||||
<atom:NumericUpDown Value="3" />
|
<atom:NumericUpDown Value="3" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three sizes of NumberUpDown" Description="There are three sizes of an Input box: large (40px), default (32px) and small (24px).">
|
<desktop:ShowCaseItem Title="Three sizes of NumberUpDown"
|
||||||
|
Description="There are three sizes of an Input box: large (40px), default (32px) and small (24px).">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -49,7 +49,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="With clear icon" Description="Input box with the remove icon, click the icon to delete everything.">
|
<desktop:ShowCaseItem Title="With clear icon"
|
||||||
|
Description="Input box with the remove icon, click the icon to delete everything.">
|
||||||
<atom:NumericUpDown Width="400"
|
<atom:NumericUpDown Width="400"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
IsEnableClearButton="True"
|
IsEnableClearButton="True"
|
||||||
@ -58,11 +59,12 @@
|
|||||||
|
|
||||||
<desktop:ShowCaseItem Title="prefix and suffix" Description="Add a prefix or suffix icons inside input.">
|
<desktop:ShowCaseItem Title="prefix and suffix" Description="Add a prefix or suffix icons inside input.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:NumericUpDown InnerLeftContent="{atom:IconProvider Kind=UserOutlined,
|
<atom:NumericUpDown
|
||||||
|
InnerLeftContent="{atom:IconProvider Kind=UserOutlined,
|
||||||
NormalFilledColor=#D7D7D7}"
|
NormalFilledColor=#D7D7D7}"
|
||||||
InnerRightContent="{atom:IconProvider Kind=InfoCircleOutlined,
|
InnerRightContent="{atom:IconProvider Kind=InfoCircleOutlined,
|
||||||
NormalFilledColor=#8C8C8C}"
|
NormalFilledColor=#8C8C8C}"
|
||||||
Watermark="Enter your value" />
|
Watermark="Enter your value" />
|
||||||
<atom:NumericUpDown InnerLeftContent="¥" InnerRightContent="RMB" />
|
<atom:NumericUpDown InnerLeftContent="¥" InnerRightContent="RMB" />
|
||||||
<atom:NumericUpDown InnerLeftContent="¥"
|
<atom:NumericUpDown InnerLeftContent="¥"
|
||||||
InnerRightContent="RMB"
|
InnerRightContent="RMB"
|
||||||
@ -70,7 +72,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Status" Description="Add status to Input with status, which could be error or warning.">
|
<desktop:ShowCaseItem Title="Status"
|
||||||
|
Description="Add status to Input with status, which could be error or warning.">
|
||||||
<StackPanel Margin="0,0,20,0"
|
<StackPanel Margin="0,0,20,0"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class NumberUpDownShowCase : UserControl
|
public partial class NumberUpDownShowCase : UserControl
|
||||||
{
|
{
|
||||||
public NumberUpDownShowCase()
|
public NumberUpDownShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -3,14 +3,12 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.Xaml"
|
xmlns:converters="clr-namespace:Avalonia.Markup.Xaml.Converters;assembly=Avalonia.Markup.Xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
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"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
d:DesignHeight="1000"
|
d:DesignHeight="1000"
|
||||||
d:DesignWidth="1920"
|
d:DesignWidth="1920"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<converters:ColorToBrushConverter x:Key="ColorToBrushConverter" />
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
<UserControl.Styles>
|
<UserControl.Styles>
|
||||||
|
@ -12,32 +12,32 @@ public partial class Overview : UserControl
|
|||||||
public string MainInstall { get; set; } = "dotnet add package AtomUI --version 11.0.7";
|
public string MainInstall { get; set; } = "dotnet add package AtomUI --version 11.0.7";
|
||||||
|
|
||||||
public string MainStyle { get; set; } = """
|
public string MainStyle { get; set; } = """
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://AtomUI/Themes/Index.axaml" />
|
<StyleInclude Source="avares://AtomUI/Themes/Index.axaml" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string ColorPickerInstall { get; set; } = "dotnet add package AtomUI.ColorPicker --version 11.0.7";
|
public string ColorPickerInstall { get; set; } = "dotnet add package AtomUI.ColorPicker --version 11.0.7";
|
||||||
|
|
||||||
public string ColorPickerStyle { get; set; } = """
|
public string ColorPickerStyle { get; set; } = """
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://AtomUI.ColorPicker/Index.axaml" />
|
<StyleInclude Source="avares://AtomUI.ColorPicker/Index.axaml" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string DataGridInstall { get; set; } = "dotnet add package AtomUI.DataGrid --version 11.0.7";
|
public string DataGridInstall { get; set; } = "dotnet add package AtomUI.DataGrid --version 11.0.7";
|
||||||
|
|
||||||
public string DataGridStyle { get; set; } = """
|
public string DataGridStyle { get; set; } = """
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://AtomUI.DataGrid/Index.axaml" />
|
<StyleInclude Source="avares://AtomUI.DataGrid/Index.axaml" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
|
|
||||||
public string TreeDataGridInstall { get; set; } = "dotnet add package AtomUI.TreeDataGrid --version 11.0.7";
|
public string TreeDataGridInstall { get; set; } = "dotnet add package AtomUI.TreeDataGrid --version 11.0.7";
|
||||||
|
|
||||||
public string TreeDataGridStyle { get; set; } = """
|
public string TreeDataGridStyle { get; set; } = """
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<StyleInclude Source="avares://AtomUI.TreeDataGrid/Index.axaml" />
|
<StyleInclude Source="avares://AtomUI.TreeDataGrid/Index.axaml" />
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
""";
|
""";
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.PaginationShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.PaginationShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class PaginationShowCase : UserControl
|
public partial class PaginationShowCase : UserControl
|
||||||
{
|
{
|
||||||
public PaginationShowCase()
|
public PaginationShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
|
using AtomUI.Demo.Desktop.ViewModels;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Controls.Primitives;
|
using Avalonia.Controls.Primitives;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
using AtomUI.Demo.Desktop.ViewModels;
|
|
||||||
|
|
||||||
namespace AtomUI.Demo.Desktop.ShowCase;
|
namespace AtomUI.Demo.Desktop.ShowCase;
|
||||||
|
|
||||||
@ -12,14 +12,11 @@ public partial class PaletteShowCase : UserControl
|
|||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnApplyTemplate(e);
|
base.OnApplyTemplate(e);
|
||||||
PaletteDemoViewModel vm = new PaletteDemoViewModel();
|
var vm = new PaletteDemoViewModel();
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() => { vm.InitializeResources(); });
|
||||||
{
|
|
||||||
vm.InitializeResources();
|
|
||||||
});
|
|
||||||
DataContext = vm;
|
DataContext = vm;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic usage" Description="The basic example supports the title and description props of confirmation.">
|
<desktop:ShowCaseItem Title="Basic usage"
|
||||||
|
Description="The basic example supports the title and description props of confirmation.">
|
||||||
<atom:PopupConfirm Title="Delete the task"
|
<atom:PopupConfirm Title="Delete the task"
|
||||||
CancelText="Cancel"
|
CancelText="Cancel"
|
||||||
ConfirmContent="Are you sure to delete this task?"
|
ConfirmContent="Are you sure to delete this task?"
|
||||||
@ -17,7 +17,8 @@
|
|||||||
</atom:PopupConfirm>
|
</atom:PopupConfirm>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Locale text" Description="Set okText and cancelText props to customize the button's labels.">
|
<desktop:ShowCaseItem Title="Locale text"
|
||||||
|
Description="Set okText and cancelText props to customize the button's labels.">
|
||||||
<atom:PopupConfirm Title="Delete the task" ConfirmContent="Are you sure to delete this task?">
|
<atom:PopupConfirm Title="Delete the task" ConfirmContent="Are you sure to delete this task?">
|
||||||
<atom:Button ButtonType="Default" IsDanger="True">Delete</atom:Button>
|
<atom:Button ButtonType="Default" IsDanger="True">Delete</atom:Button>
|
||||||
</atom:PopupConfirm>
|
</atom:PopupConfirm>
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class PopupConfirmShowCase : UserControl
|
public partial class PopupConfirmShowCase : UserControl
|
||||||
{
|
{
|
||||||
public PopupConfirmShowCase()
|
public PopupConfirmShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCasePanel.Styles>
|
<desktop:ShowCasePanel.Styles>
|
||||||
@ -118,7 +117,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Custom text format" Description="You can set a custom text by setting the format prop.">
|
<desktop:ShowCaseItem Title="Custom text format"
|
||||||
|
Description="You can set a custom text by setting the format prop.">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<atom:CircleProgress Maximum="100"
|
<atom:CircleProgress Maximum="100"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
@ -130,7 +130,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Dashboard" Description="By setting type=dashboard, you can get a dashboard style of progress easily. Modify gapDegree to set the degree of gap.">
|
<desktop:ShowCaseItem Title="Dashboard"
|
||||||
|
Description="By setting type=dashboard, you can get a dashboard style of progress easily. Modify gapDegree to set the degree of gap.">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<atom:DashboardProgress DashboardGapPosition="Left"
|
<atom:DashboardProgress DashboardGapPosition="Left"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
@ -153,7 +154,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Progress bar with success segment" Description="Show several parts of progress with different status.">
|
<desktop:ShowCaseItem Title="Progress bar with success segment"
|
||||||
|
Description="Show several parts of progress with different status.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:ProgressBar Maximum="100"
|
<atom:ProgressBar Maximum="100"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
@ -174,7 +176,8 @@
|
|||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Stroke Linecap" Description="By setting strokeLinecap='butt', you can change the linecaps from round to butt, see stroke-linecap for more information.">
|
<desktop:ShowCaseItem Title="Stroke Linecap"
|
||||||
|
Description="By setting strokeLinecap='butt', you can change the linecaps from round to butt, see stroke-linecap for more information.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:ProgressBar Maximum="100"
|
<atom:ProgressBar Maximum="100"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
@ -193,7 +196,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Custom line gradient" Description="Gradient encapsulation, circle and dashboard will ignore strokeLinecap when setting gradient.">
|
<desktop:ShowCaseItem Title="Custom line gradient"
|
||||||
|
Description="Gradient encapsulation, circle and dashboard will ignore strokeLinecap when setting gradient.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:ProgressBar IndicatorBarBrush="{Binding TwoStopsGradientStrokeColor}"
|
<atom:ProgressBar IndicatorBarBrush="{Binding TwoStopsGradientStrokeColor}"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
@ -266,7 +270,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Circular progress bar whit steps" Description="A circular progress bar that support steps and color segments, default gap is 2px.">
|
<desktop:ShowCaseItem Title="Circular progress bar whit steps"
|
||||||
|
Description="A circular progress bar that support steps and color segments, default gap is 2px.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="5">
|
<StackPanel Orientation="Vertical" Spacing="5">
|
||||||
<WrapPanel Orientation="Horizontal">
|
<WrapPanel Orientation="Horizontal">
|
||||||
<atom:CircleProgress IndicatorThickness="20"
|
<atom:CircleProgress IndicatorThickness="20"
|
||||||
@ -327,7 +332,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Circular progress bar whit steps" Description="A circular progress bar that support steps and color segments, default gap is 2px.">
|
<desktop:ShowCaseItem Title="Circular progress bar whit steps"
|
||||||
|
Description="A circular progress bar that support steps and color segments, default gap is 2px.">
|
||||||
<StackPanel x:Name="CircleWithStep"
|
<StackPanel x:Name="CircleWithStep"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="5">
|
Spacing="5">
|
||||||
@ -424,7 +430,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Change progress value position" Description="Change the position of the progress value, you can use percentPosition to adjust it so that the progress bar value is inside, outside or at the bottom of the progress bar.">
|
<desktop:ShowCaseItem Title="Change progress value position"
|
||||||
|
Description="Change the position of the progress value, you can use percentPosition to adjust it so that the progress bar value is inside, outside or at the bottom of the progress bar.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:ProgressBar Width="300"
|
<atom:ProgressBar Width="300"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
@ -472,7 +479,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Change progress value position for StepsProgressBar" Description="Change the position of the progress value, you can use percentPosition to adjust it so that the progress bar value is inside, outside or at the bottom of the progress bar.">
|
<desktop:ShowCaseItem Title="Change progress value position for StepsProgressBar"
|
||||||
|
Description="Change the position of the progress value, you can use percentPosition to adjust it so that the progress bar value is inside, outside or at the bottom of the progress bar.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:StepsProgressBar Maximum="100"
|
<atom:StepsProgressBar Maximum="100"
|
||||||
Minimum="0"
|
Minimum="0"
|
||||||
@ -520,7 +528,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Vertical progress bar" Description="Ordinary linear progress bar, supports position specification of additional areas">
|
<desktop:ShowCaseItem Title="Vertical progress bar"
|
||||||
|
Description="Ordinary linear progress bar, supports position specification of additional areas">
|
||||||
<StackPanel Height="300"
|
<StackPanel Height="300"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -576,7 +585,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Vertical progress bar" Description="Ordinary step progress bar, supports position specification of additional areas">
|
<desktop:ShowCaseItem Title="Vertical progress bar"
|
||||||
|
Description="Ordinary step progress bar, supports position specification of additional areas">
|
||||||
<StackPanel Height="300"
|
<StackPanel Height="300"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -618,7 +628,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Vertical progress bar" Description="Ordinary step progress bar, supports position specification of additional areas">
|
<desktop:ShowCaseItem Title="Vertical progress bar"
|
||||||
|
Description="Ordinary step progress bar, supports position specification of additional areas">
|
||||||
<StackPanel Height="300"
|
<StackPanel Height="300"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
@ -660,7 +671,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="toggle disabled status" Description="The progress bar is in the disabled state and uses the disabled style.">
|
<desktop:ShowCaseItem Title="toggle disabled status"
|
||||||
|
Description="The progress bar is in the disabled state and uses the disabled style.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:ProgressBar IsEnabled="{Binding ToggleStatus}"
|
<atom:ProgressBar IsEnabled="{Binding ToggleStatus}"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
|
@ -7,130 +7,129 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ProgressBarShowCase : UserControl
|
public partial class ProgressBarShowCase : UserControl
|
||||||
{
|
{
|
||||||
public LinearGradientBrush TwoStopsGradientStrokeColor { get; set; }
|
public static readonly StyledProperty<double> ProgressValueProperty =
|
||||||
|
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(ProgressValue), 30);
|
||||||
|
|
||||||
public LinearGradientBrush ThreeStopsGradientStrokeColor { get; set; }
|
public static readonly StyledProperty<string> ToggleDisabledTextProperty =
|
||||||
|
AvaloniaProperty.Register<ProgressBarShowCase, string>(nameof(ToggleDisabledText), "Disable");
|
||||||
|
|
||||||
public List<IBrush> StepsChunkBrushes { get; set; }
|
public static readonly StyledProperty<bool> ToggleStatusProperty =
|
||||||
|
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(ToggleStatus), true);
|
||||||
|
|
||||||
public PercentPosition InnerStartPercentPosition { get; set; }
|
public ProgressBarShowCase()
|
||||||
public PercentPosition InnerCenterPercentPosition { get; set; }
|
{
|
||||||
public PercentPosition InnerEndPercentPosition { get; set; }
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
public PercentPosition OutterStartPercentPosition { get; set; }
|
|
||||||
public PercentPosition OutterCenterPercentPosition { get; set; }
|
|
||||||
public PercentPosition OutterEndPercentPosition { get; set; }
|
|
||||||
|
|
||||||
public static readonly StyledProperty<double> ProgressValueProperty =
|
TwoStopsGradientStrokeColor = new LinearGradientBrush
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, double>(nameof(ProgressValue), 30);
|
{
|
||||||
|
GradientStops =
|
||||||
public static readonly StyledProperty<string> ToggleDisabledTextProperty =
|
{
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, string>(nameof(ToggleDisabledText), "Disable");
|
new GradientStop(Color.Parse("#108ee9"), 0),
|
||||||
|
new GradientStop(Color.Parse("#87d068"), 1)
|
||||||
public static readonly StyledProperty<bool> ToggleStatusProperty =
|
}
|
||||||
AvaloniaProperty.Register<ProgressBarShowCase, bool>(nameof(ToggleStatus), true);
|
};
|
||||||
|
ThreeStopsGradientStrokeColor = new LinearGradientBrush
|
||||||
public double ProgressValue
|
{
|
||||||
{
|
GradientStops =
|
||||||
get => GetValue(ProgressValueProperty);
|
{
|
||||||
set => SetValue(ProgressValueProperty, value);
|
new GradientStop(Color.Parse("#87d068"), 0),
|
||||||
}
|
new GradientStop(Color.Parse("#ffe58f"), 0.5),
|
||||||
|
new GradientStop(Color.Parse("#ffccc7"), 1)
|
||||||
public string ToggleDisabledText
|
}
|
||||||
{
|
};
|
||||||
get => GetValue(ToggleDisabledTextProperty);
|
StepsChunkBrushes = new List<IBrush>
|
||||||
set => SetValue(ToggleDisabledTextProperty, value);
|
{
|
||||||
}
|
new SolidColorBrush(Colors.Green),
|
||||||
|
new SolidColorBrush(Colors.Green),
|
||||||
public bool ToggleStatus
|
new SolidColorBrush(Colors.Red)
|
||||||
{
|
};
|
||||||
get => GetValue(ToggleStatusProperty);
|
|
||||||
set => SetValue(ToggleStatusProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProgressBarShowCase()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
DataContext = this;
|
|
||||||
|
|
||||||
TwoStopsGradientStrokeColor = new LinearGradientBrush()
|
InnerStartPercentPosition = new PercentPosition
|
||||||
{
|
{
|
||||||
GradientStops =
|
IsInner = true,
|
||||||
{
|
Alignment = LinePercentAlignment.Start
|
||||||
new GradientStop(Color.Parse("#108ee9"), 0),
|
};
|
||||||
new GradientStop(Color.Parse("#87d068"), 1)
|
InnerCenterPercentPosition = new PercentPosition
|
||||||
}
|
{
|
||||||
};
|
IsInner = true,
|
||||||
ThreeStopsGradientStrokeColor = new LinearGradientBrush()
|
Alignment = LinePercentAlignment.Center
|
||||||
{
|
};
|
||||||
GradientStops =
|
InnerEndPercentPosition = new PercentPosition
|
||||||
{
|
{
|
||||||
new GradientStop(Color.Parse("#87d068"), 0),
|
IsInner = true,
|
||||||
new GradientStop(Color.Parse("#ffe58f"), 0.5),
|
Alignment = LinePercentAlignment.End
|
||||||
new GradientStop(Color.Parse("#ffccc7"), 1)
|
};
|
||||||
}
|
|
||||||
};
|
|
||||||
StepsChunkBrushes = new List<IBrush>()
|
|
||||||
{
|
|
||||||
new SolidColorBrush(Colors.Green),
|
|
||||||
new SolidColorBrush(Colors.Green),
|
|
||||||
new SolidColorBrush(Colors.Red)
|
|
||||||
};
|
|
||||||
|
|
||||||
InnerStartPercentPosition = new PercentPosition()
|
OutterStartPercentPosition = new PercentPosition
|
||||||
{
|
{
|
||||||
IsInner = true,
|
IsInner = false,
|
||||||
Alignment = LinePercentAlignment.Start
|
Alignment = LinePercentAlignment.Start
|
||||||
};
|
};
|
||||||
InnerCenterPercentPosition = new PercentPosition()
|
OutterCenterPercentPosition = new PercentPosition
|
||||||
{
|
{
|
||||||
IsInner = true,
|
IsInner = false,
|
||||||
Alignment = LinePercentAlignment.Center
|
Alignment = LinePercentAlignment.Center
|
||||||
};
|
};
|
||||||
InnerEndPercentPosition = new PercentPosition()
|
OutterEndPercentPosition = new PercentPosition
|
||||||
{
|
{
|
||||||
IsInner = true,
|
IsInner = false,
|
||||||
Alignment = LinePercentAlignment.End
|
Alignment = LinePercentAlignment.End
|
||||||
};
|
};
|
||||||
|
}
|
||||||
OutterStartPercentPosition = new PercentPosition()
|
|
||||||
{
|
|
||||||
IsInner = false,
|
|
||||||
Alignment = LinePercentAlignment.Start
|
|
||||||
};
|
|
||||||
OutterCenterPercentPosition = new PercentPosition()
|
|
||||||
{
|
|
||||||
IsInner = false,
|
|
||||||
Alignment = LinePercentAlignment.Center
|
|
||||||
};
|
|
||||||
OutterEndPercentPosition = new PercentPosition()
|
|
||||||
{
|
|
||||||
IsInner = false,
|
|
||||||
Alignment = LinePercentAlignment.End
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddProgressValue()
|
public LinearGradientBrush TwoStopsGradientStrokeColor { get; set; }
|
||||||
{
|
|
||||||
var value = ProgressValue;
|
|
||||||
value += 10;
|
|
||||||
ProgressValue = Math.Min(value, 100);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SubProgressValue()
|
public LinearGradientBrush ThreeStopsGradientStrokeColor { get; set; }
|
||||||
{
|
|
||||||
var value = ProgressValue;
|
|
||||||
value -= 10;
|
|
||||||
ProgressValue = Math.Max(value, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ToggleEnabledStatus()
|
public List<IBrush> StepsChunkBrushes { get; set; }
|
||||||
{
|
|
||||||
ToggleStatus = !ToggleStatus;
|
public PercentPosition InnerStartPercentPosition { get; set; }
|
||||||
if (ToggleStatus) {
|
public PercentPosition InnerCenterPercentPosition { get; set; }
|
||||||
ToggleDisabledText = "Disable";
|
public PercentPosition InnerEndPercentPosition { get; set; }
|
||||||
} else {
|
|
||||||
ToggleDisabledText = "Enable";
|
public PercentPosition OutterStartPercentPosition { get; set; }
|
||||||
}
|
public PercentPosition OutterCenterPercentPosition { get; set; }
|
||||||
}
|
public PercentPosition OutterEndPercentPosition { get; set; }
|
||||||
|
|
||||||
|
public double ProgressValue
|
||||||
|
{
|
||||||
|
get => GetValue(ProgressValueProperty);
|
||||||
|
set => SetValue(ProgressValueProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ToggleDisabledText
|
||||||
|
{
|
||||||
|
get => GetValue(ToggleDisabledTextProperty);
|
||||||
|
set => SetValue(ToggleDisabledTextProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool ToggleStatus
|
||||||
|
{
|
||||||
|
get => GetValue(ToggleStatusProperty);
|
||||||
|
set => SetValue(ToggleStatusProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AddProgressValue()
|
||||||
|
{
|
||||||
|
var value = ProgressValue;
|
||||||
|
value += 10;
|
||||||
|
ProgressValue = Math.Min(value, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SubProgressValue()
|
||||||
|
{
|
||||||
|
var value = ProgressValue;
|
||||||
|
value -= 10;
|
||||||
|
ProgressValue = Math.Max(value, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ToggleEnabledStatus()
|
||||||
|
{
|
||||||
|
ToggleStatus = !ToggleStatus;
|
||||||
|
if (ToggleStatus)
|
||||||
|
ToggleDisabledText = "Disable";
|
||||||
|
else
|
||||||
|
ToggleDisabledText = "Enable";
|
||||||
|
}
|
||||||
}
|
}
|
@ -140,7 +140,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size type" Description="There are three sizes available: large, medium, and small. It can coordinate with input box.">
|
<desktop: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">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<atom:OptionButtonGroup SizeType="Large">
|
<atom:OptionButtonGroup SizeType="Large">
|
||||||
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
<atom:OptionButton IsChecked="True">Hangzhou</atom:OptionButton>
|
||||||
|
@ -4,30 +4,26 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class RadioButtonShowCase : UserControl
|
public partial class RadioButtonShowCase : UserControl
|
||||||
{
|
{
|
||||||
protected List<string> CheckRadios { get; set; }
|
public RadioButtonShowCase()
|
||||||
|
{
|
||||||
|
CheckRadios = new List<string>
|
||||||
|
{
|
||||||
|
"ToggleDisabledRadioUnChecked",
|
||||||
|
"ToggleDisabledRadioChecked"
|
||||||
|
};
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
public RadioButtonShowCase()
|
protected List<string> CheckRadios { get; set; }
|
||||||
{
|
|
||||||
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) {
|
public static void ToggleDisabledStatus(object arg)
|
||||||
radioBtn2.IsEnabled = !radioBtn2.IsEnabled;
|
{
|
||||||
}
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The most basic usage.">
|
<desktop:ShowCaseItem Title="Basic" Description="The most basic usage.">
|
||||||
@ -22,7 +21,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Block Segmented" Description="block property will make the Segmented fit to its parent width.">
|
<desktop:ShowCaseItem Title="Block Segmented"
|
||||||
|
Description="block property will make the Segmented fit to its parent width.">
|
||||||
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
<StackPanel HorizontalAlignment="Stretch" Orientation="Vertical">
|
||||||
<atom:Segmented IsExpanding="True">
|
<atom:Segmented IsExpanding="True">
|
||||||
<atom:SegmentedItem>123</atom:SegmentedItem>
|
<atom:SegmentedItem>123</atom:SegmentedItem>
|
||||||
@ -51,7 +51,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three sizes of Segmented" Description="There are three sizes of an Segmented: large (40px), default (32px) and small (24px).">
|
<desktop:ShowCaseItem Title="Three sizes of Segmented"
|
||||||
|
Description="There are three sizes of an Segmented: large (40px), default (32px) and small (24px).">
|
||||||
<StackPanel HorizontalAlignment="Left"
|
<StackPanel HorizontalAlignment="Left"
|
||||||
Orientation="Vertical"
|
Orientation="Vertical"
|
||||||
Spacing="10">
|
Spacing="10">
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class SegmentedShowCase : UserControl
|
public partial class SegmentedShowCase : UserControl
|
||||||
{
|
{
|
||||||
public SegmentedShowCase()
|
public SegmentedShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Horizontal" Description="A Separator is horizontal by default. You can add text within Separator.">
|
<desktop:ShowCaseItem Title="Horizontal"
|
||||||
|
Description="A Separator is horizontal by default. You can add text within Separator.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||||
@ -24,7 +24,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Divider with title" Description="Divider with inner title, set orientation='left/right' to align it.">
|
<desktop:ShowCaseItem Title="Divider with title"
|
||||||
|
Description="Divider with inner title, set orientation='left/right' to align it.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||||
@ -65,7 +66,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Text without heading style" Description="You can use non-heading style of divider text by setting the plain property.">
|
<desktop:ShowCaseItem Title="Text without heading style"
|
||||||
|
Description="You can use non-heading style of divider text by setting the plain property.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed nonne merninisti licere mihi ista probare, quae sunt a te dicta? Refert tamen, quo modo.
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class SeparatorShowCase : UserControl
|
public partial class SeparatorShowCase : UserControl
|
||||||
{
|
{
|
||||||
public SeparatorShowCase()
|
public SeparatorShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Basic slider. When range is true, display as dual thumb mode. When disable is true, the slider will not be interactable.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="Basic slider. When range is true, display as dual thumb mode. When disable is true, the slider will not be interactable.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:Slider IsEnabled="{Binding NormalEnabled}"
|
<atom:Slider IsEnabled="{Binding NormalEnabled}"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
@ -37,7 +37,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Customize tooltip" Description="Use tooltip.formatter to format content of Tooltip. If tooltip.formatter is null, hide it.">
|
<desktop:ShowCaseItem Title="Customize tooltip"
|
||||||
|
Description="Use tooltip.formatter to format content of Tooltip. If tooltip.formatter is null, hide it.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:Slider IsSnapToTickEnabled="True"
|
<atom:Slider IsSnapToTickEnabled="True"
|
||||||
Maximum="100"
|
Maximum="100"
|
||||||
@ -84,7 +85,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Graduated slider" Description="Using marks property to mark a graduated slider, use value or defaultValue to specify the position of thumb. When included is false, means that different thumbs are coordinative. when step is null, users can only slide the thumbs onto marks.">
|
<desktop:ShowCaseItem Title="Graduated slider"
|
||||||
|
Description="Using marks property to mark a graduated slider, use value or defaultValue to specify the position of thumb. When included is false, means that different thumbs are coordinative. when step is null, users can only slide the thumbs onto marks.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<TextBlock FontWeight="Bold">included=true</TextBlock>
|
<TextBlock FontWeight="Bold">included=true</TextBlock>
|
||||||
<atom:Slider Marks="{Binding SliderMarks}"
|
<atom:Slider Marks="{Binding SliderMarks}"
|
||||||
|
@ -8,36 +8,36 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class SliderShowCase : UserControl
|
public partial class SliderShowCase : UserControl
|
||||||
{
|
{
|
||||||
|
public static readonly StyledProperty<AvaloniaList<SliderMark>?> SliderMarksProperty =
|
||||||
public static readonly StyledProperty<AvaloniaList<SliderMark>?> SliderMarksProperty =
|
AvaloniaProperty.Register<SliderShowCase, AvaloniaList<SliderMark>?>(nameof(SliderMarks));
|
||||||
AvaloniaProperty.Register<SliderShowCase, AvaloniaList<SliderMark>?>(nameof(SliderMarks));
|
|
||||||
|
public static readonly StyledProperty<bool> NormalDisabledProperty =
|
||||||
public static readonly StyledProperty<bool> NormalDisabledProperty =
|
AvaloniaProperty.Register<SliderShowCase, bool>(nameof(NormalEnabled), true);
|
||||||
AvaloniaProperty.Register<SliderShowCase, bool>(nameof(NormalEnabled), true);
|
|
||||||
|
public SliderShowCase()
|
||||||
public AvaloniaList<SliderMark>? SliderMarks {
|
{
|
||||||
get => GetValue(SliderMarksProperty);
|
InitializeComponent();
|
||||||
set => SetValue(SliderMarksProperty, value);
|
SliderMarks = new AvaloniaList<SliderMark>();
|
||||||
}
|
SliderMarks.Add(new SliderMark("0°C", 0));
|
||||||
|
SliderMarks.Add(new SliderMark("26°C", 26));
|
||||||
public bool NormalEnabled {
|
SliderMarks.Add(new SliderMark("37°C", 37));
|
||||||
get => GetValue(NormalDisabledProperty);
|
SliderMarks.Add(new SliderMark("100°C", 100)
|
||||||
set => SetValue(NormalDisabledProperty, value);
|
{
|
||||||
}
|
LabelFontWeight = FontWeight.Bold,
|
||||||
|
LabelBrush = new SolidColorBrush(Colors.Red)
|
||||||
public SliderShowCase()
|
});
|
||||||
{
|
DataContext = this;
|
||||||
InitializeComponent();
|
}
|
||||||
SliderMarks = new AvaloniaList<SliderMark>();
|
|
||||||
SliderMarks.Add(new SliderMark("0°C", 0));
|
public AvaloniaList<SliderMark>? SliderMarks
|
||||||
SliderMarks.Add(new SliderMark("26°C", 26));
|
{
|
||||||
SliderMarks.Add(new SliderMark("37°C", 37));
|
get => GetValue(SliderMarksProperty);
|
||||||
SliderMarks.Add(new SliderMark("100°C", 100)
|
set => SetValue(SliderMarksProperty, value);
|
||||||
{
|
}
|
||||||
LabelFontWeight = FontWeight.Bold,
|
|
||||||
LabelBrush = new SolidColorBrush(Colors.Red)
|
public bool NormalEnabled
|
||||||
});
|
{
|
||||||
DataContext = this;
|
get => GetValue(NormalDisabledProperty);
|
||||||
}
|
set => SetValue(NormalDisabledProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The most basic SplitButton.">
|
<desktop:ShowCaseItem Title="Basic" Description="The most basic SplitButton.">
|
||||||
@ -27,7 +26,8 @@
|
|||||||
</atom:SplitButton>
|
</atom:SplitButton>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="AtomUI supports three sizes of buttons: small, default and large. If a large or small button is desired, set the size property to either large or small respectively. Omit the size property for a button with the default size.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="AtomUI supports three sizes of buttons: small, default and large. If a large or small button is desired, set the size property to either large or small respectively. Omit the size property for a button with the default size.">
|
||||||
<desktop:ShowCaseItem.Styles>
|
<desktop:ShowCaseItem.Styles>
|
||||||
<Style Selector="atom|SplitButton">
|
<Style Selector="atom|SplitButton">
|
||||||
<Setter Property="Margin" Value="5" />
|
<Setter Property="Margin" Value="5" />
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class SplitButtonShowCase : UserControl
|
public partial class SplitButtonShowCase : UserControl
|
||||||
{
|
{
|
||||||
public SplitButtonShowCase()
|
public SplitButtonShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,31 +6,25 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class SwitchShowCase : UserControl
|
public partial class SwitchShowCase : UserControl
|
||||||
{
|
{
|
||||||
public SwitchShowCase()
|
public SwitchShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void ToggleDisabledStatus(object arg)
|
public static void ToggleDisabledStatus(object arg)
|
||||||
{
|
{
|
||||||
var switchBtn = (arg as ToggleSwitch)!;
|
var switchBtn = (arg as ToggleSwitch)!;
|
||||||
switchBtn.IsEnabled = !switchBtn.IsEnabled;
|
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) {
|
public static void ToggleLoadingStatus(object arg)
|
||||||
toggleSwitchSmall.IsLoading = !toggleSwitchSmall.IsLoading;
|
{
|
||||||
}
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<TabControl>
|
<TabControl>
|
||||||
<TabItem Header="TabControl">
|
<TabItem Header="TabControl">
|
||||||
@ -64,7 +63,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Slide" Description="In order to fit in more tabs, they can slide left and right (or up and down).">
|
<desktop:ShowCaseItem Title="Slide"
|
||||||
|
Description="In order to fit in more tabs, they can slide left and right (or up and down).">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:TabControl>
|
<atom:TabControl>
|
||||||
<atom:TabItem Header="Tab 1">Content of Tab Pane 1</atom:TabItem>
|
<atom:TabItem Header="Tab 1">Content of Tab Pane 1</atom:TabItem>
|
||||||
@ -114,7 +114,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Card type tab" Description="Another type of Tabs, which doesn't support vertical mode.">
|
<desktop:ShowCaseItem Title="Card type tab"
|
||||||
|
Description="Another type of Tabs, which doesn't support vertical mode.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
|
|
||||||
<atom:CardTabControl>
|
<atom:CardTabControl>
|
||||||
@ -126,7 +127,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Position" Description="Tab's position: left, right, top or bottom. Will auto switch to top in mobile.">
|
<desktop:ShowCaseItem Title="Position"
|
||||||
|
Description="Tab's position: left, right, top or bottom. Will auto switch to top in mobile.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
||||||
@ -197,7 +199,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="Large size tabs are usually used in page header, and small size could be used in Modal.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="Large size tabs are usually used in page header, and small size could be used in Modal.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
||||||
@ -294,7 +297,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Slide" Description="In order to fit in more tabs, they can slide left and right (or up and down).">
|
<desktop:ShowCaseItem Title="Slide"
|
||||||
|
Description="In order to fit in more tabs, they can slide left and right (or up and down).">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:TabStrip>
|
<atom:TabStrip>
|
||||||
<atom:TabStripItem>Tab 1</atom:TabStripItem>
|
<atom:TabStripItem>Tab 1</atom:TabStripItem>
|
||||||
@ -324,7 +328,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Card type tab" Description="Another type of Tabs, which doesn't support vertical mode.">
|
<desktop:ShowCaseItem Title="Card type tab"
|
||||||
|
Description="Another type of Tabs, which doesn't support vertical mode.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<atom:CardTabStrip>
|
<atom:CardTabStrip>
|
||||||
<atom:TabStripItem Icon="{atom:IconProvider Kind=AppleOutlined}">Tab 1</atom:TabStripItem>
|
<atom:TabStripItem Icon="{atom:IconProvider Kind=AppleOutlined}">Tab 1</atom:TabStripItem>
|
||||||
@ -336,7 +341,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Position" Description="Tab's position: left, right, top or bottom. Will auto switch to top in mobile.">
|
<desktop:ShowCaseItem Title="Position"
|
||||||
|
Description="Tab's position: left, right, top or bottom. Will auto switch to top in mobile.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
||||||
@ -401,7 +407,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Size" Description="Large size tabs are usually used in page header, and small size could be used in Modal.">
|
<desktop:ShowCaseItem Title="Size"
|
||||||
|
Description="Large size tabs are usually used in page header, and small size could be used in Modal.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="20">
|
<StackPanel Orientation="Vertical" Spacing="20">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
<TextBlock VerticalAlignment="Center">Tab position:</TextBlock>
|
||||||
|
@ -8,180 +8,185 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TabControlShowCase : UserControl
|
public partial class TabControlShowCase : UserControl
|
||||||
{
|
{
|
||||||
#region TabStrip
|
public TabControlShowCase()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
DataContext = this;
|
||||||
|
PositionTabStripOptionGroup.OptionCheckedChanged += HandleTabStripPlacementOptionCheckedChanged;
|
||||||
|
PositionCardTabStripOptionGroup.OptionCheckedChanged += HandleCardTabStripPlacementOptionCheckedChanged;
|
||||||
|
SizeTypeTabStripOptionGroup.OptionCheckedChanged += HandleTabStripSizeTypeOptionCheckedChanged;
|
||||||
|
AddTabDemoStrip.AddTabRequest += HandleTabStripAddTabRequest;
|
||||||
|
|
||||||
public static readonly StyledProperty<Dock> PositionTabStripPlacementProperty =
|
PositionTabControlOptionGroup.OptionCheckedChanged += HandleTabControlPlacementOptionCheckedChanged;
|
||||||
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionTabStripPlacement), Dock.Top);
|
PositionCardTabControlOptionGroup.OptionCheckedChanged += HandleCardTabControlPlacementOptionCheckedChanged;
|
||||||
|
SizeTypeTabControlOptionGroup.OptionCheckedChanged += HandleTabControlSizeTypeOptionCheckedChanged;
|
||||||
public static readonly StyledProperty<Dock> PositionCardTabStripPlacementProperty =
|
AddTabDemoTabControl.AddTabRequest += HandleTabControlAddTabRequest;
|
||||||
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionCardTabStripPlacement), Dock.Top);
|
}
|
||||||
|
|
||||||
public static readonly StyledProperty<SizeType> SizeTypeTabStripProperty =
|
|
||||||
AvaloniaProperty.Register<TabControlShowCase, SizeType>(nameof(SizeTypeTabStrip), SizeType.Middle);
|
|
||||||
|
|
||||||
public Dock PositionTabStripPlacement
|
|
||||||
{
|
|
||||||
get => GetValue(PositionTabStripPlacementProperty);
|
|
||||||
set => SetValue(PositionTabStripPlacementProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dock PositionCardTabStripPlacement
|
|
||||||
{
|
|
||||||
get => GetValue(PositionCardTabStripPlacementProperty);
|
|
||||||
set => SetValue(PositionCardTabStripPlacementProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SizeType SizeTypeTabStrip
|
|
||||||
{
|
|
||||||
get => GetValue(SizeTypeTabStripProperty);
|
|
||||||
set => SetValue(SizeTypeTabStripProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region TabControl
|
|
||||||
|
|
||||||
public static readonly StyledProperty<Dock> PositionTabControlPlacementProperty =
|
#region TabStrip
|
||||||
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionTabControlPlacement), Dock.Top);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<Dock> PositionCardTabControlPlacementProperty =
|
|
||||||
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionCardTabControlPlacement), Dock.Top);
|
|
||||||
|
|
||||||
public static readonly StyledProperty<SizeType> SizeTypeTabControlProperty =
|
|
||||||
AvaloniaProperty.Register<TabControlShowCase, SizeType>(nameof(SizeTypeTabControl), SizeType.Middle);
|
|
||||||
|
|
||||||
public Dock PositionTabControlPlacement
|
|
||||||
{
|
|
||||||
get => GetValue(PositionTabControlPlacementProperty);
|
|
||||||
set => SetValue(PositionTabControlPlacementProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Dock PositionCardTabControlPlacement
|
|
||||||
{
|
|
||||||
get => GetValue(PositionCardTabControlPlacementProperty);
|
|
||||||
set => SetValue(PositionCardTabControlPlacementProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public SizeType SizeTypeTabControl
|
|
||||||
{
|
|
||||||
get => GetValue(SizeTypeTabControlProperty);
|
|
||||||
set => SetValue(SizeTypeTabControlProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion
|
public static readonly StyledProperty<Dock> PositionTabStripPlacementProperty =
|
||||||
|
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionTabStripPlacement), Dock.Top);
|
||||||
public TabControlShowCase()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
DataContext = this;
|
|
||||||
PositionTabStripOptionGroup.OptionCheckedChanged += HandleTabStripPlacementOptionCheckedChanged;
|
|
||||||
PositionCardTabStripOptionGroup.OptionCheckedChanged += HandleCardTabStripPlacementOptionCheckedChanged;
|
|
||||||
SizeTypeTabStripOptionGroup.OptionCheckedChanged += HandleTabStripSizeTypeOptionCheckedChanged;
|
|
||||||
AddTabDemoStrip.AddTabRequest += HandleTabStripAddTabRequest;
|
|
||||||
|
|
||||||
PositionTabControlOptionGroup.OptionCheckedChanged += HandleTabControlPlacementOptionCheckedChanged;
|
public static readonly StyledProperty<Dock> PositionCardTabStripPlacementProperty =
|
||||||
PositionCardTabControlOptionGroup.OptionCheckedChanged += HandleCardTabControlPlacementOptionCheckedChanged;
|
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionCardTabStripPlacement), Dock.Top);
|
||||||
SizeTypeTabControlOptionGroup.OptionCheckedChanged += HandleTabControlSizeTypeOptionCheckedChanged;
|
|
||||||
AddTabDemoTabControl.AddTabRequest += HandleTabControlAddTabRequest;
|
|
||||||
}
|
|
||||||
|
|
||||||
#region TabStrip
|
public static readonly StyledProperty<SizeType> SizeTypeTabStripProperty =
|
||||||
private void HandleTabStripPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
AvaloniaProperty.Register<TabControlShowCase, SizeType>(nameof(SizeTypeTabStrip), SizeType.Middle);
|
||||||
{
|
|
||||||
if (args.Index == 0) {
|
|
||||||
PositionTabStripPlacement = Dock.Top;
|
|
||||||
} else if (args.Index == 1) {
|
|
||||||
PositionTabStripPlacement = Dock.Bottom;
|
|
||||||
} else if (args.Index == 2) {
|
|
||||||
PositionTabStripPlacement = Dock.Left;
|
|
||||||
} else {
|
|
||||||
PositionTabStripPlacement = Dock.Right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleCardTabStripPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Index == 0) {
|
|
||||||
PositionCardTabStripPlacement = Dock.Top;
|
|
||||||
} else if (args.Index == 1) {
|
|
||||||
PositionCardTabStripPlacement = Dock.Bottom;
|
|
||||||
} else if (args.Index == 2) {
|
|
||||||
PositionCardTabStripPlacement = Dock.Left;
|
|
||||||
} else {
|
|
||||||
PositionCardTabStripPlacement = Dock.Right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleTabStripSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Index == 0) {
|
|
||||||
SizeTypeTabStrip = SizeType.Small;
|
|
||||||
} else if (args.Index == 1) {
|
|
||||||
SizeTypeTabStrip = SizeType.Middle;
|
|
||||||
} else {
|
|
||||||
SizeTypeTabStrip = SizeType.Large;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleTabStripAddTabRequest(object? sender, RoutedEventArgs args)
|
|
||||||
{
|
|
||||||
var index = AddTabDemoStrip.ItemCount;
|
|
||||||
AddTabDemoStrip.Items.Add(new TabStripItem()
|
|
||||||
{
|
|
||||||
Content = $"new tab {index}",
|
|
||||||
IsClosable = true
|
|
||||||
});
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
|
|
||||||
#region TabControl
|
|
||||||
private void HandleTabControlPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
|
||||||
{
|
|
||||||
if (args.Index == 0) {
|
|
||||||
PositionTabControlPlacement = Dock.Top;
|
|
||||||
} else if (args.Index == 1) {
|
|
||||||
PositionTabControlPlacement = Dock.Bottom;
|
|
||||||
} else if (args.Index == 2) {
|
|
||||||
PositionTabControlPlacement = Dock.Left;
|
|
||||||
} else {
|
|
||||||
PositionTabControlPlacement = Dock.Right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void HandleCardTabControlPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
public Dock PositionTabStripPlacement
|
||||||
{
|
{
|
||||||
if (args.Index == 0) {
|
get => GetValue(PositionTabStripPlacementProperty);
|
||||||
PositionCardTabControlPlacement = Dock.Top;
|
set => SetValue(PositionTabStripPlacementProperty, value);
|
||||||
} else if (args.Index == 1) {
|
}
|
||||||
PositionCardTabControlPlacement = Dock.Bottom;
|
|
||||||
} else if (args.Index == 2) {
|
public Dock PositionCardTabStripPlacement
|
||||||
PositionCardTabControlPlacement = Dock.Left;
|
{
|
||||||
} else {
|
get => GetValue(PositionCardTabStripPlacementProperty);
|
||||||
PositionCardTabControlPlacement = Dock.Right;
|
set => SetValue(PositionCardTabStripPlacementProperty, value);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public SizeType SizeTypeTabStrip
|
||||||
private void HandleTabControlSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
{
|
||||||
{
|
get => GetValue(SizeTypeTabStripProperty);
|
||||||
if (args.Index == 0) {
|
set => SetValue(SizeTypeTabStripProperty, value);
|
||||||
SizeTypeTabControl = SizeType.Small;
|
}
|
||||||
} else if (args.Index == 1) {
|
|
||||||
SizeTypeTabControl = SizeType.Middle;
|
#endregion
|
||||||
} else {
|
|
||||||
SizeTypeTabControl = SizeType.Large;
|
|
||||||
}
|
|
||||||
}
|
#region TabControl
|
||||||
|
|
||||||
private void HandleTabControlAddTabRequest(object? sender, RoutedEventArgs args)
|
public static readonly StyledProperty<Dock> PositionTabControlPlacementProperty =
|
||||||
{
|
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionTabControlPlacement), Dock.Top);
|
||||||
var index = AddTabDemoTabControl.ItemCount;
|
|
||||||
AddTabDemoTabControl.Items.Add(new TabItem()
|
public static readonly StyledProperty<Dock> PositionCardTabControlPlacementProperty =
|
||||||
{
|
AvaloniaProperty.Register<TabControlShowCase, Dock>(nameof(PositionCardTabControlPlacement), Dock.Top);
|
||||||
Header = $"new tab {index}",
|
|
||||||
Content = $"new tab content {index}",
|
public static readonly StyledProperty<SizeType> SizeTypeTabControlProperty =
|
||||||
IsClosable = true
|
AvaloniaProperty.Register<TabControlShowCase, SizeType>(nameof(SizeTypeTabControl), SizeType.Middle);
|
||||||
});
|
|
||||||
}
|
public Dock PositionTabControlPlacement
|
||||||
#endregion
|
{
|
||||||
|
get => GetValue(PositionTabControlPlacementProperty);
|
||||||
|
set => SetValue(PositionTabControlPlacementProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Dock PositionCardTabControlPlacement
|
||||||
|
{
|
||||||
|
get => GetValue(PositionCardTabControlPlacementProperty);
|
||||||
|
set => SetValue(PositionCardTabControlPlacementProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SizeType SizeTypeTabControl
|
||||||
|
{
|
||||||
|
get => GetValue(SizeTypeTabControlProperty);
|
||||||
|
set => SetValue(SizeTypeTabControlProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region TabStrip
|
||||||
|
|
||||||
|
private void HandleTabStripPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
PositionTabStripPlacement = Dock.Top;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
PositionTabStripPlacement = Dock.Bottom;
|
||||||
|
else if (args.Index == 2)
|
||||||
|
PositionTabStripPlacement = Dock.Left;
|
||||||
|
else
|
||||||
|
PositionTabStripPlacement = Dock.Right;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleCardTabStripPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
PositionCardTabStripPlacement = Dock.Top;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
PositionCardTabStripPlacement = Dock.Bottom;
|
||||||
|
else if (args.Index == 2)
|
||||||
|
PositionCardTabStripPlacement = Dock.Left;
|
||||||
|
else
|
||||||
|
PositionCardTabStripPlacement = Dock.Right;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleTabStripSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
SizeTypeTabStrip = SizeType.Small;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
SizeTypeTabStrip = SizeType.Middle;
|
||||||
|
else
|
||||||
|
SizeTypeTabStrip = SizeType.Large;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleTabStripAddTabRequest(object? sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
var index = AddTabDemoStrip.ItemCount;
|
||||||
|
AddTabDemoStrip.Items.Add(new TabStripItem
|
||||||
|
{
|
||||||
|
Content = $"new tab {index}",
|
||||||
|
IsClosable = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#region TabControl
|
||||||
|
|
||||||
|
private void HandleTabControlPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
PositionTabControlPlacement = Dock.Top;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
PositionTabControlPlacement = Dock.Bottom;
|
||||||
|
else if (args.Index == 2)
|
||||||
|
PositionTabControlPlacement = Dock.Left;
|
||||||
|
else
|
||||||
|
PositionTabControlPlacement = Dock.Right;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleCardTabControlPlacementOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
PositionCardTabControlPlacement = Dock.Top;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
PositionCardTabControlPlacement = Dock.Bottom;
|
||||||
|
else if (args.Index == 2)
|
||||||
|
PositionCardTabControlPlacement = Dock.Left;
|
||||||
|
else
|
||||||
|
PositionCardTabControlPlacement = Dock.Right;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleTabControlSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args)
|
||||||
|
{
|
||||||
|
if (args.Index == 0)
|
||||||
|
SizeTypeTabControl = SizeType.Small;
|
||||||
|
else if (args.Index == 1)
|
||||||
|
SizeTypeTabControl = SizeType.Middle;
|
||||||
|
else
|
||||||
|
SizeTypeTabControl = SizeType.Large;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleTabControlAddTabRequest(object? sender, RoutedEventArgs args)
|
||||||
|
{
|
||||||
|
var index = AddTabDemoTabControl.ItemCount;
|
||||||
|
AddTabDemoTabControl.Items.Add(new TabItem
|
||||||
|
{
|
||||||
|
Header = $"new tab {index}",
|
||||||
|
Content = $"new tab content {index}",
|
||||||
|
IsClosable = true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCasePanel.Styles>
|
<desktop:ShowCasePanel.Styles>
|
||||||
@ -13,7 +12,8 @@
|
|||||||
<Setter Property="Margin" Value="5" />
|
<Setter Property="Margin" Value="5" />
|
||||||
</Style>
|
</Style>
|
||||||
</desktop:ShowCasePanel.Styles>
|
</desktop:ShowCasePanel.Styles>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Usage of basic Tag, and it could be IsClosable and customize close button by set closeIcon property,will display default close button when closeIcon is setting to true. IsClosable Tag supports onClose events.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="Usage of basic Tag, and it could be IsClosable and customize close button by set closeIcon property,will display default close button when closeIcon is setting to true. IsClosable Tag supports onClose events.">
|
||||||
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<atom:Tag>Tag 1</atom:Tag>
|
<atom:Tag>Tag 1</atom:Tag>
|
||||||
<atom:Tag>Link</atom:Tag>
|
<atom:Tag>Link</atom:Tag>
|
||||||
@ -27,7 +27,8 @@
|
|||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop: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.">
|
<desktop: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">
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBlock Margin="0,0,0,10"
|
<TextBlock Margin="0,0,0,10"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
@ -63,7 +64,8 @@
|
|||||||
|
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop: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.">
|
<desktop: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">
|
<StackPanel Orientation="Vertical">
|
||||||
<TextBlock Margin="0,0,0,10"
|
<TextBlock Margin="0,0,0,10"
|
||||||
FontSize="14"
|
FontSize="14"
|
||||||
@ -125,7 +127,8 @@
|
|||||||
|
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop: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.">
|
<desktop: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">
|
<WrapPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
||||||
<atom:Tag TagColor="#55acee">
|
<atom:Tag TagColor="#55acee">
|
||||||
<atom:Tag.Icon>
|
<atom:Tag.Icon>
|
||||||
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TagShowCase : UserControl
|
public partial class TagShowCase : UserControl
|
||||||
{
|
{
|
||||||
public TagShowCase()
|
public TagShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,14 +5,15 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="Click TimePicker, and then we could select or input a time in panel.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="Click TimePicker, and then we could select or input a time in panel.">
|
||||||
<atom:TimePicker Width="200" Watermark="Select time" />
|
<atom:TimePicker Width="200" Watermark="Select time" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Three Sizes" Description="The input box comes in three sizes: large, middle and small. Large is used in the form, while the medium size is the default.">
|
<desktop:ShowCaseItem Title="Three Sizes"
|
||||||
|
Description="The input box comes in three sizes: large, middle and small. Large is used in the form, while the medium size is the default.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:TimePicker Width="160"
|
<atom:TimePicker Width="160"
|
||||||
DefaultTime="12:08:23"
|
DefaultTime="12:08:23"
|
||||||
@ -38,7 +39,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Interval option" Description="Show stepped options by MinuteIncrement SecondIncrement.">
|
<desktop:ShowCaseItem Title="Interval option"
|
||||||
|
Description="Show stepped options by MinuteIncrement SecondIncrement.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:TimePicker Width="160"
|
<atom:TimePicker Width="160"
|
||||||
DefaultTime="12:08:23"
|
DefaultTime="12:08:23"
|
||||||
@ -48,7 +50,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="12 hours" Description="TimePicker of 12 hours format, with default format h:mm:ss a.">
|
<desktop:ShowCaseItem Title="12 hours"
|
||||||
|
Description="TimePicker of 12 hours format, with default format h:mm:ss a.">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<atom:TimePicker Width="160"
|
<atom:TimePicker Width="160"
|
||||||
ClockIdentifier="HourClock12"
|
ClockIdentifier="HourClock12"
|
||||||
@ -90,7 +93,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Status" Description="Add status to TimePicker with status, which could be error or warning.">
|
<desktop:ShowCaseItem Title="Status"
|
||||||
|
Description="Add status to TimePicker with status, which could be error or warning.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="5">
|
<StackPanel Orientation="Horizontal" Spacing="5">
|
||||||
<atom:TimePicker Width="160"
|
<atom:TimePicker Width="160"
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TimePickerShowCase : UserControl
|
public partial class TimePickerShowCase : UserControl
|
||||||
{
|
{
|
||||||
public TimePickerShowCase()
|
public TimePickerShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.TimelineShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.TimelineShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,9 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TimelineShowCase : UserControl
|
public partial class TimelineShowCase : UserControl
|
||||||
{
|
{
|
||||||
public TimelineShowCase()
|
public TimelineShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.TitleBarShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.TitleBarShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TitleBarShowCase : UserControl
|
public partial class TitleBarShowCase : UserControl
|
||||||
{
|
{
|
||||||
public TitleBarShowCase()
|
public TitleBarShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,11 +1,9 @@
|
|||||||
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.ToolBarShowCase"
|
<UserControl x:Class="AtomUI.Demo.Desktop.ShowCase.ToolBarShowCase"
|
||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:atom="https://atomui.net"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel />
|
<desktop:ShowCasePanel />
|
||||||
</UserControl>
|
</UserControl>
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class ToolBarShowCase : UserControl
|
public partial class ToolBarShowCase : UserControl
|
||||||
{
|
{
|
||||||
public ToolBarShowCase()
|
public ToolBarShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage.">
|
<desktop:ShowCaseItem Title="Basic" Description="The simplest usage.">
|
||||||
@ -256,7 +255,8 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Colorful Tooltip" Description="We preset a series of colorful Tooltip styles for use in different situations.">
|
<desktop:ShowCaseItem Title="Colorful Tooltip"
|
||||||
|
Description="We preset a series of colorful Tooltip styles for use in different situations.">
|
||||||
<desktop:ShowCaseItem.Styles>
|
<desktop:ShowCaseItem.Styles>
|
||||||
<Style Selector="atom|Button">
|
<Style Selector="atom|Button">
|
||||||
<Setter Property="Margin" Value="5" />
|
<Setter Property="Margin" Value="5" />
|
||||||
|
@ -6,45 +6,49 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TooltipShowCase : UserControl
|
public partial class TooltipShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<bool> ShowArrowProperty =
|
public static readonly StyledProperty<bool> ShowArrowProperty =
|
||||||
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(ShowArrow), true);
|
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(ShowArrow), true);
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> IsPointAtCenterProperty =
|
|
||||||
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(IsPointAtCenter), false);
|
|
||||||
|
|
||||||
private Segmented _segmented;
|
public static readonly StyledProperty<bool> IsPointAtCenterProperty =
|
||||||
|
AvaloniaProperty.Register<TooltipShowCase, bool>(nameof(IsPointAtCenter));
|
||||||
public bool ShowArrow
|
|
||||||
{
|
private readonly Segmented _segmented;
|
||||||
get => GetValue(ShowArrowProperty);
|
|
||||||
set => SetValue(ShowArrowProperty, value);
|
public TooltipShowCase()
|
||||||
}
|
{
|
||||||
|
DataContext = this;
|
||||||
public bool IsPointAtCenter
|
InitializeComponent();
|
||||||
{
|
var control = this as Control;
|
||||||
get => GetValue(IsPointAtCenterProperty);
|
_segmented = control.FindControl<Segmented>("ArrowSegmented")!;
|
||||||
set => SetValue(IsPointAtCenterProperty, value);
|
_segmented.SelectionChanged += (sender, args) =>
|
||||||
}
|
{
|
||||||
|
if (_segmented.SelectedIndex == 0)
|
||||||
public TooltipShowCase()
|
{
|
||||||
{
|
ShowArrow = true;
|
||||||
DataContext = this;
|
IsPointAtCenter = false;
|
||||||
InitializeComponent();
|
}
|
||||||
var control = this as Control;
|
else if (_segmented.SelectedIndex == 1)
|
||||||
_segmented = control.FindControl<Segmented>("ArrowSegmented")!;
|
{
|
||||||
_segmented.SelectionChanged += (sender, args) =>
|
ShowArrow = false;
|
||||||
{
|
IsPointAtCenter = false;
|
||||||
if (_segmented.SelectedIndex == 0) {
|
}
|
||||||
ShowArrow = true;
|
else if (_segmented.SelectedIndex == 2)
|
||||||
IsPointAtCenter = false;
|
{
|
||||||
} else if (_segmented.SelectedIndex == 1) {
|
IsPointAtCenter = true;
|
||||||
ShowArrow = false;
|
ShowArrow = true;
|
||||||
IsPointAtCenter = false;
|
}
|
||||||
} else if (_segmented.SelectedIndex == 2) {
|
};
|
||||||
IsPointAtCenter = true;
|
}
|
||||||
ShowArrow = true;
|
|
||||||
}
|
public bool ShowArrow
|
||||||
};
|
{
|
||||||
}
|
get => GetValue(ShowArrowProperty);
|
||||||
|
set => SetValue(ShowArrowProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsPointAtCenter
|
||||||
|
{
|
||||||
|
get => GetValue(IsPointAtCenterProperty);
|
||||||
|
set => SetValue(IsPointAtCenterProperty, value);
|
||||||
|
}
|
||||||
}
|
}
|
@ -5,10 +5,10 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
<desktop:ShowCaseItem Title="Basic" Description="The most basic usage, tell you how to use checkable, selectable, disabled, defaultExpandKeys, and etc.">
|
<desktop:ShowCaseItem Title="Basic"
|
||||||
|
Description="The most basic usage, tell you how to use checkable, selectable, disabled, defaultExpandKeys, and etc.">
|
||||||
<atom:TreeView IsCheckable="True" IsDefaultExpandAll="True">
|
<atom:TreeView IsCheckable="True" IsDefaultExpandAll="True">
|
||||||
<atom:TreeViewItem Header="parent 1">
|
<atom:TreeViewItem Header="parent 1">
|
||||||
<atom:TreeViewItem Header="parent 1-0">
|
<atom:TreeViewItem Header="parent 1-0">
|
||||||
@ -35,7 +35,8 @@
|
|||||||
</atom:TreeView>
|
</atom:TreeView>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Tree with line" Description="Tree with connected line between nodes, turn on by showLine, customize the preset icon by switcherIcon.">
|
<desktop:ShowCaseItem Title="Tree with line"
|
||||||
|
Description="Tree with connected line between nodes, turn on by showLine, customize the preset icon by switcherIcon.">
|
||||||
<StackPanel Orientation="Vertical" Spacing="10">
|
<StackPanel Orientation="Vertical" Spacing="10">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="10">
|
<StackPanel Orientation="Horizontal" Spacing="10">
|
||||||
<TextBlock>showLine:</TextBlock>
|
<TextBlock>showLine:</TextBlock>
|
||||||
|
@ -5,37 +5,36 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class TreeViewShowCase : UserControl
|
public partial class TreeViewShowCase : UserControl
|
||||||
{
|
{
|
||||||
public static readonly StyledProperty<bool> ShowLineSwitchCheckedProperty =
|
public static readonly StyledProperty<bool> ShowLineSwitchCheckedProperty =
|
||||||
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowLineSwitchChecked), true);
|
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowLineSwitchChecked), true);
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> ShowIconSwitchCheckedProperty =
|
public static readonly StyledProperty<bool> ShowIconSwitchCheckedProperty =
|
||||||
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowIconSwitchChecked), false);
|
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowIconSwitchChecked));
|
||||||
|
|
||||||
public static readonly StyledProperty<bool> ShowLeafSwitcherSwitchCheckedProperty =
|
public static readonly StyledProperty<bool> ShowLeafSwitcherSwitchCheckedProperty =
|
||||||
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowLeafSwitcherSwitchChecked), false);
|
AvaloniaProperty.Register<TreeViewShowCase, bool>(nameof(ShowLeafSwitcherSwitchChecked));
|
||||||
|
|
||||||
public bool ShowLineSwitchChecked
|
public TreeViewShowCase()
|
||||||
{
|
{
|
||||||
get => GetValue(ShowLineSwitchCheckedProperty);
|
InitializeComponent();
|
||||||
set => SetValue(ShowLineSwitchCheckedProperty, value);
|
DataContext = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShowIconSwitchChecked
|
public bool ShowLineSwitchChecked
|
||||||
{
|
{
|
||||||
get => GetValue(ShowIconSwitchCheckedProperty);
|
get => GetValue(ShowLineSwitchCheckedProperty);
|
||||||
set => SetValue(ShowIconSwitchCheckedProperty, value);
|
set => SetValue(ShowLineSwitchCheckedProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ShowLeafSwitcherSwitchChecked
|
public bool ShowIconSwitchChecked
|
||||||
{
|
{
|
||||||
get => GetValue(ShowLeafSwitcherSwitchCheckedProperty);
|
get => GetValue(ShowIconSwitchCheckedProperty);
|
||||||
set => SetValue(ShowLeafSwitcherSwitchCheckedProperty, value);
|
set => SetValue(ShowIconSwitchCheckedProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TreeViewShowCase()
|
public bool ShowLeafSwitcherSwitchChecked
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
get => GetValue(ShowLeafSwitcherSwitchCheckedProperty);
|
||||||
DataContext = this;
|
set => SetValue(ShowLeafSwitcherSwitchCheckedProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -5,7 +5,6 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:showcase="clr-namespace:AtomUI.Demo.Desktop.ShowCase"
|
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
<desktop:ShowCasePanel>
|
<desktop:ShowCasePanel>
|
||||||
|
|
||||||
@ -13,11 +12,14 @@
|
|||||||
<Border Height="300" atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI'}" />
|
<Border Height="300" atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI'}" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Multi-line watermark" Description="Use line-break to specify multi-line text watermark content.">
|
<desktop:ShowCaseItem Title="Multi-line watermark"
|
||||||
<Border Height="200" atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI
Happy Working', FontSize=18, Foreground=Gray}" />
|
Description="Use line-break to specify multi-line text watermark content.">
|
||||||
|
<Border Height="200"
|
||||||
|
atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI
Happy Working', FontSize=18, Foreground=Gray}" />
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Image watermark" Description="Specify the image address via image. To ensure that the image is high definition and not stretched, set the width and height, and upload at least twice the width and height of the logo image address.">
|
<desktop:ShowCaseItem Title="Image watermark"
|
||||||
|
Description="Specify the image address via image. To ensure that the image is high definition and not stretched, set the width and height, and upload at least twice the width and height of the logo image address.">
|
||||||
<Border Height="400">
|
<Border Height="400">
|
||||||
<atom:Watermark.Glyph>
|
<atom:Watermark.Glyph>
|
||||||
<atom:ImageGlyph Source="/Assets/ATOMUI-LOGO.png" />
|
<atom:ImageGlyph Source="/Assets/ATOMUI-LOGO.png" />
|
||||||
@ -26,12 +28,16 @@
|
|||||||
</Border>
|
</Border>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
|
||||||
<desktop:ShowCaseItem Title="Custom configuration" Description="Preview the watermark effect by configuring custom parameters.">
|
<desktop:ShowCaseItem Title="Custom configuration"
|
||||||
|
Description="Preview the watermark effect by configuring custom parameters.">
|
||||||
<StackPanel atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI'}">
|
<StackPanel atom:Watermark.Glyph="{atom:TextGlyph 'AtomUI'}">
|
||||||
<TextBlock TextWrapping="Wrap">
|
<TextBlock TextWrapping="Wrap">
|
||||||
The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design.<LineBreak /><LineBreak />
|
The light-speed iteration of the digital world makes products more complex. However, human consciousness and attention resources are limited. Facing this design contradiction, the pursuit of natural interaction will be the consistent direction of Ant Design.
|
||||||
Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience.<LineBreak /><LineBreak />
|
<LineBreak /><LineBreak />
|
||||||
Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural.</TextBlock>
|
Natural user cognition: According to cognitive psychology, about 80% of external information is obtained through visual channels. The most important visual elements in the interface design, including layout, colors, illustrations, icons, etc., should fully absorb the laws of nature, thereby reducing the user's cognitive cost and bringing authentic and smooth feelings. In some scenarios, opportunely adding other sensory channels such as hearing, touch can create a richer and more natural product experience.
|
||||||
|
<LineBreak /><LineBreak />
|
||||||
|
Natural user behavior: In the interaction with the system, the designer should fully understand the relationship between users, system roles, and task objectives, and also contextually organize system functions and services. At the same time, a series of methods such as behavior analysis, artificial intelligence and sensors could be applied to assist users to make effective decisions and reduce extra operations of users, to save users' mental and physical resources and make human-computer interaction more natural.
|
||||||
|
</TextBlock>
|
||||||
<Image Source="/Assets/watermark-sample.png" />
|
<Image Source="/Assets/watermark-sample.png" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</desktop:ShowCaseItem>
|
</desktop:ShowCaseItem>
|
||||||
|
@ -4,8 +4,8 @@ namespace AtomUI.Demo.Desktop.ShowCase;
|
|||||||
|
|
||||||
public partial class WatermarkShowCase : UserControl
|
public partial class WatermarkShowCase : UserControl
|
||||||
{
|
{
|
||||||
public WatermarkShowCase()
|
public WatermarkShowCase()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,7 +20,8 @@
|
|||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
</ItemsPresenter.ItemsPanel>
|
</ItemsPresenter.ItemsPanel>
|
||||||
</ItemsPresenter>
|
</ItemsPresenter>
|
||||||
<Border Name="PART_BorderSeparator" Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
<Border Name="PART_BorderSeparator"
|
||||||
|
Background="{DynamicResource TabItemLinePipePressedBorderBrush}" />
|
||||||
</Panel>
|
</Panel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<ContentPresenter Name="PART_SelectedContentHost"
|
<ContentPresenter Name="PART_SelectedContentHost"
|
||||||
@ -39,4 +40,4 @@
|
|||||||
<Setter Property="HorizontalAlignment" Value="Left" />
|
<Setter Property="HorizontalAlignment" Value="Left" />
|
||||||
</Style>
|
</Style>
|
||||||
</ControlTheme>
|
</ControlTheme>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user