atomui/samples/AtomUI.Demo.Desktop/ShowCase/IconShowCase.axaml.cs
2024-07-30 10:14:09 +08:00

25 lines
589 B
C#

using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.Threading;
using AtomUI.Demo.Desktop.ViewModels;
namespace AtomUI.Demo.Desktop.ShowCase;
public partial class IconShowCase : UserControl
{
public IconShowCase()
{
InitializeComponent();
}
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
PaletteDemoViewModel vm = new PaletteDemoViewModel();
await Dispatcher.UIThread.InvokeAsync(() =>
{
vm.InitializeResources();
});
DataContext = vm;
}
}