mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-04-22 23:46:29 +03:00
Кнопка настроек теперь в верхнем левом углу
This commit is contained in:
@@ -1,17 +1,22 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using KeyKeeper.Views;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace KeyKeeper.ViewModels;
|
||||
|
||||
public partial class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
public string Greeting { get; } = "Welcome to Avalonia!";
|
||||
|
||||
[RelayCommand]
|
||||
private void OpenSettings()
|
||||
private async void OpenSettings()
|
||||
{
|
||||
var settingsWindow = new SettingsWindow();
|
||||
settingsWindow.Show();
|
||||
await settingsWindow.ShowDialog(GetMainWindow());
|
||||
}
|
||||
private static Window? GetMainWindow()
|
||||
{
|
||||
return App.Current?.ApplicationLifetime is Avalonia.Controls.ApplicationLifetimes.IClassicDesktopStyleApplicationLifetime desktop
|
||||
? desktop.MainWindow
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user