Files
LehrerApp/LehrerApp.Desktop/Views/DevicePairingDialog.axaml.cs
2026-03-29 23:47:31 +02:00

35 lines
870 B
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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();
}
}