mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-29 04:33:22 +08:00
feat: add VariablesDemo.
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
@@ -16,13 +13,10 @@ public partial class PaletteDemo : UserControl
|
||||
this.DataContext = new PaletteDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
PaletteDemoViewModel? vm = this.DataContext as PaletteDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||
{
|
||||
vm?.InitializeResources();
|
||||
});
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user