main
 1using System.Windows;
 2
 3namespace solidware.financials.windows.ui
 4{
 5    public class WPFDialog<TPresenter> : Window, Dialog<TPresenter> where TPresenter : DialogPresenter
 6    {
 7        public WPFDialog()
 8        {
 9            WindowStartupLocation = WindowStartupLocation.CenterOwner;
10            ShowInTaskbar = false;
11            WindowStyle = WindowStyle.SingleBorderWindow;
12        }
13
14        public void open(TPresenter presenter)
15        {
16            DataContext = presenter;
17            Owner = Application.Current.MainWindow;
18            presenter.close = () => Close();
19            presenter.present();
20            ShowDialog();
21        }
22    }
23}