Initial
This commit is contained in:
34
LehrerApp.Desktop/Views/DevicePairingDialog.axaml.cs
Normal file
34
LehrerApp.Desktop/Views/DevicePairingDialog.axaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using LehrerApp.Desktop.ViewModels;
|
||||
|
||||
namespace LehrerApp.Desktop.Views;
|
||||
|
||||
public partial class DevicePairingDialog : Window
|
||||
{
|
||||
// Wird von außen gesetzt – Pfad zur lokalen DB
|
||||
public string TargetDbPath { get; set; } = "";
|
||||
|
||||
// Signal: App-Neustart nötig
|
||||
public bool RestartRequested { get; private set; }
|
||||
|
||||
public DevicePairingDialog()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void OnClose(object? sender, RoutedEventArgs e) =>
|
||||
Close();
|
||||
|
||||
private async void OnRestore(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
if (DataContext is DevicePairingViewModel vm)
|
||||
await vm.RestoreCommand.ExecuteAsync(TargetDbPath);
|
||||
}
|
||||
|
||||
private void OnRestartRequested(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
RestartRequested = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user