public MainWindow() { _viewModel = new MainWindowViewModel(DialogCoordinator.Instance); DataContext = _viewModel; InitializeComponent(); flyoutDemo = new FlyoutDemo(); flyoutDemo.ApplyTemplate(); flyoutDemo.Closed += (o, e) => flyoutDemo = null; }
public MainWindow() { _viewModel = new MainWindowViewModel(); DataContext = _viewModel; InitializeComponent(); flyoutDemo = new FlyoutDemo(); flyoutDemo.ApplyTemplate(); flyoutDemo.Closed += (o, e) => flyoutDemo = null; Closing += (s, e) => { if (!e.Cancel && flyoutDemo != null) { flyoutDemo.Dispose(); } }; }