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

22 lines
572 B
C#

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