mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-02 12:56:31 +03:00
Кнопка настроек теперь в верхнем левом углу
This commit is contained in:
@@ -1,17 +1,22 @@
|
|||||||
using CommunityToolkit.Mvvm.ComponentModel;
|
using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using KeyKeeper.Views;
|
using KeyKeeper.Views;
|
||||||
|
using Avalonia.Controls;
|
||||||
|
|
||||||
namespace KeyKeeper.ViewModels;
|
namespace KeyKeeper.ViewModels;
|
||||||
|
|
||||||
public partial class MainWindowViewModel : ViewModelBase
|
public partial class MainWindowViewModel : ViewModelBase
|
||||||
{
|
{
|
||||||
public string Greeting { get; } = "Welcome to Avalonia!";
|
public string Greeting { get; } = "Welcome to Avalonia!";
|
||||||
|
|
||||||
[RelayCommand]
|
[RelayCommand]
|
||||||
private void OpenSettings()
|
private async void OpenSettings()
|
||||||
{
|
{
|
||||||
var settingsWindow = new SettingsWindow();
|
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