mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-03-03 00:00:55 +08:00
25 lines
633 B
C#
25 lines
633 B
C#
using Avalonia;
|
|
using Avalonia.Controls.ApplicationLifetimes;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using CommunityToolkit.Mvvm.Input;
|
|
using CommunityToolkit.Mvvm.Messaging;
|
|
|
|
namespace Semi.Avalonia.Demo.ViewModels;
|
|
|
|
public partial class ApplicationViewModel : ObservableObject
|
|
{
|
|
[RelayCommand]
|
|
private void JumpTo(string header)
|
|
{
|
|
WeakReferenceMessenger.Default.Send(header, "JumpTo");
|
|
}
|
|
|
|
[RelayCommand]
|
|
private void Exit()
|
|
{
|
|
if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
|
{
|
|
desktop.Shutdown();
|
|
}
|
|
}
|
|
} |