mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-08 10:16:35 +08:00
feat: add VariablesDemo.
This commit is contained in:
22
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml.cs
Normal file
22
demo/Semi.Avalonia.Demo/Pages/VariablesDemo.axaml.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Threading;
|
||||
using Semi.Avalonia.Demo.ViewModels;
|
||||
|
||||
namespace Semi.Avalonia.Demo.Pages;
|
||||
|
||||
public partial class VariablesDemo : UserControl
|
||||
{
|
||||
public VariablesDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.DataContext = new VariablesDemoViewModel();
|
||||
}
|
||||
|
||||
protected override async void OnApplyTemplate(TemplateAppliedEventArgs e)
|
||||
{
|
||||
base.OnApplyTemplate(e);
|
||||
var vm = this.DataContext as VariablesDemoViewModel;
|
||||
await Dispatcher.UIThread.InvokeAsync(() => { vm?.InitializeResources(); });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user