diff --git a/src/App/ViewModels/MainWindowViewModel.cs b/src/App/ViewModels/MainWindowViewModel.cs
index f8679fc..50ecde0 100644
--- a/src/App/ViewModels/MainWindowViewModel.cs
+++ b/src/App/ViewModels/MainWindowViewModel.cs
@@ -249,6 +249,17 @@ public partial class MainWindowViewModel : ViewModelBase
[ObservableProperty]
private AddressRow? selectedAddressRow;
+ /// Dettaglio indirizzo mostrato nell'overlay in-app; null = nascosto.
+ [ObservableProperty]
+ private AddressInfo? addressInfo;
+
+ /// Apre l'overlay con i dati dell'indirizzo passato.
+ public void ShowAddressInfo(AddressRow row) =>
+ AddressInfo = new AddressInfo(Loc, row.Indirizzo, row.DerivPath, row.PubKey, row.PrivKey);
+
+ [RelayCommand]
+ private void CloseAddressInfo() => AddressInfo = null;
+
// ---- rubrica contatti ----
public ObservableCollection Contacts { get; } = [];
diff --git a/src/App/Views/AddressInfoWindow.axaml b/src/App/Views/AddressInfoWindow.axaml
deleted file mode 100644
index c451f1b..0000000
--- a/src/App/Views/AddressInfoWindow.axaml
+++ /dev/null
@@ -1,49 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/App/Views/AddressInfoWindow.axaml.cs b/src/App/Views/AddressInfoWindow.axaml.cs
deleted file mode 100644
index 59db832..0000000
--- a/src/App/Views/AddressInfoWindow.axaml.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-using Avalonia.Controls;
-using Avalonia.Interactivity;
-using PalladiumWallet.App.ViewModels;
-
-namespace PalladiumWallet.App.Views;
-
-public partial class AddressInfoWindow : Window
-{
- public AddressInfoWindow()
- {
- InitializeComponent();
- }
-
- public AddressInfoWindow(AddressInfo info) : this()
- {
- DataContext = info;
- }
-
- private void OnCloseClick(object? sender, RoutedEventArgs e) => Close();
-}
diff --git a/src/App/Views/MainWindow.axaml b/src/App/Views/MainWindow.axaml
index 223fc95..5018a2a 100644
--- a/src/App/Views/MainWindow.axaml
+++ b/src/App/Views/MainWindow.axaml
@@ -375,5 +375,60 @@
Padding="10,6">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/App/Views/MainWindow.axaml.cs b/src/App/Views/MainWindow.axaml.cs
index f255620..4ab0e86 100644
--- a/src/App/Views/MainWindow.axaml.cs
+++ b/src/App/Views/MainWindow.axaml.cs
@@ -37,15 +37,14 @@ public partial class MainWindow : Window
vm.OpenFromPath(path);
}
- private async void OnAddressListTapped(object? sender, TappedEventArgs e)
+ private void OnAddressListTapped(object? sender, TappedEventArgs e)
{
if (DataContext is not MainWindowViewModel vm || vm.SelectedAddressRow is not { } row)
return;
- var info = new AddressInfo(vm.Loc, row.Indirizzo, row.DerivPath, row.PubKey, row.PrivKey);
- await new AddressInfoWindow(info).ShowDialog(this);
+ vm.ShowAddressInfo(row);
}
- private async void OnAddressListPointerPressed(object? sender, PointerPressedEventArgs e)
+ private void OnAddressListPointerPressed(object? sender, PointerPressedEventArgs e)
{
if (!e.GetCurrentPoint(null).Properties.IsRightButtonPressed) return;
if (sender is not ListBox lb || DataContext is not MainWindowViewModel vm) return;
@@ -54,8 +53,26 @@ public partial class MainWindow : Window
if (item is not { DataContext: AddressRow row }) return;
lb.SelectedItem = row;
+ vm.ShowAddressInfo(row);
+ }
- var info = new AddressInfo(vm.Loc, row.Indirizzo, row.DerivPath, row.PubKey, row.PrivKey);
- await new AddressInfoWindow(info).ShowDialog(this);
+ // Chiusura dell'overlay dettaglio indirizzo: click sullo sfondo scuro
+ // (solo sullo sfondo, non sulla scheda) o tasto Esc.
+ private void OnAddressOverlayBackdropTapped(object? sender, TappedEventArgs e)
+ {
+ if (!ReferenceEquals(e.Source, sender)) return;
+ if (DataContext is MainWindowViewModel vm)
+ vm.AddressInfo = null;
+ }
+
+ protected override void OnKeyDown(KeyEventArgs e)
+ {
+ if (e.Key == Key.Escape && DataContext is MainWindowViewModel { AddressInfo: not null } vm)
+ {
+ vm.AddressInfo = null;
+ e.Handled = true;
+ return;
+ }
+ base.OnKeyDown(e);
}
}