atomui/samples/AtomUI.Demo.Desktop/ShowCase/PaletteShowCase.axaml.cs

22 lines
572 B
C#
Raw Normal View History

2024-09-10 00:09:07 +08:00
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();
}
2024-09-10 00:09:07 +08:00
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
{
base.OnApplyTemplate(e);
2024-09-10 00:09:07 +08:00
var vm = new PaletteDemoViewModel();
await Dispatcher.UIThread.InvokeAsync(() => { vm.InitializeResources(); });
DataContext = vm;
}
}