public void CloseableDialogContentViewModelHelper_Add_Callback_Without_Interface_Succeeds()
        {
            var view      = new Window();
            var viewModel = new ViewModelWithoutInterface();

            view.DataContext = viewModel;

            CloseableDialogContentViewModelHelper.TryAddCloseCallback(view, ICloseableDialogContentViewModelTest.Callback);

            Assert.That(viewModel.RequestClose, Is.EqualTo(ICloseableDialogContentViewModelTest.Callback));
        }
        public void CloseableDialogContentViewModelHelper_Add_Callback_With_Alternative_Callback_Succeeds()
        {
            var view      = new Window();
            var viewModel = new ViewModelWithAlternativeCallback();

            view.DataContext = viewModel;

            CloseableDialogContentViewModelHelper.TryAddCloseCallback(view, ICloseableDialogContentViewModelTest.Callback);

            Assert.That(viewModel.RequestClose, Is.Not.Null);
        }
 internal void PrepareBeforeShown()
 {
     CloseableDialogContentViewModelHelper.TryAddCloseCallback(this.ContentView as FrameworkElement, _closeCallback);
     OptionsAwareDialogContentViewModelHelper.TryAddDialogOptions(this.ContentView as FrameworkElement, this.Options);
     this.TryAddExternalCancellationCallback();
 }