mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-05 00:37:17 +08:00
24 lines
560 B
C#
24 lines
560 B
C#
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Semi.Avalonia.Demo.ViewModels;
|
|
|
|
namespace Semi.Avalonia.Demo.Pages;
|
|
|
|
public partial class AboutUs : UserControl
|
|
{
|
|
public AboutUs()
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = new AboutUsViewModel();
|
|
}
|
|
|
|
protected override void OnLoaded(RoutedEventArgs e)
|
|
{
|
|
base.OnLoaded(e);
|
|
if (this.DataContext is AboutUsViewModel vm)
|
|
{
|
|
var launcher = TopLevel.GetTopLevel(this)?.Launcher;
|
|
vm.Launcher = launcher;
|
|
}
|
|
}
|
|
} |