53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Linq;
|
|
using System.Runtime.CompilerServices;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Avalonia.Layout;
|
|
using Avalonia.Media;
|
|
|
|
namespace Logof_Client;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
|
{
|
|
public ObservableCollection<KasPerson> Addresses { get; }
|
|
|
|
private KasPerson? _selectedAddress;
|
|
|
|
public KasPerson? SelectedAddress
|
|
{
|
|
get => _selectedAddress;
|
|
set
|
|
{
|
|
_selectedAddress = value;
|
|
PropertyChanged?.Invoke(
|
|
this,
|
|
new PropertyChangedEventArgs(nameof(SelectedAddress)));
|
|
}
|
|
}
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
|
{
|
|
InitializeComponent();
|
|
|
|
Addresses = new ObservableCollection<KasPerson>(addresses);
|
|
|
|
DataContext = this;
|
|
}
|
|
|
|
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
|
|
{
|
|
Settings.Save();
|
|
Global.Save();
|
|
}
|
|
}
|
|
|