private async void AcceptExecuted() { var result = new LocationWarningDialogResult(true, NeverShowAgain); CloseCompletionSource?.SetResult(result); await DialogNavigationService.Close(this, true, result); }
private async void DenyExecuted() { var result = new LocationWarningDialogResult(false, false); CloseCompletionSource?.SetResult(result); await DialogNavigationService.Close(this, true, result); }
public void VerifyThatNavigateFloatingWorks() { var navigation = new DialogNavigationService(this.viewList, this.viewModelList); Assert.DoesNotThrow( () => { navigation.NavigateFloating(new TestFloatingDialogViewModel(new Person(), this.session.Object)); var view = (Window)navigation.FloatingThingDialog.Single().Value; view.Close(); }); }
private void ConfigureNavigationService() { var navigationService = new DialogNavigationService(KernelInstance); navigationService.Register(Dialogs.Main, typeof(MainView)); navigationService.Register(Dialogs.LocationSelect, typeof(LocationSelectView)); navigationService.Register(Dialogs.CreateLocation, typeof(CreateLocationView)); navigationService.Register(Dialogs.CreateWeatherRecords, typeof(CreateWeatherRecordsView)); navigationService.Register(Dialogs.ReportBuilder, typeof(ReportBuilderView)); navigationService.Register(Dialogs.Error, typeof(ErrorView)); Kernel.Bind <INavigationService>().ToConstant(navigationService); }
public void VerifyThatThrowsWhenViewCantBeFound() { var navigation = new DialogNavigationService(this.viewList, this.viewModelList); Assert.Throws <ArgumentOutOfRangeException>(() => navigation.NavigateFloating(new NotfoundDialogViewModel(new Person(), this.session.Object))); }
public void VerifyThatTheServiceGetsPopulated() { this.navigationService = new DialogNavigationService(this.viewList, this.viewModelList); Assert.AreEqual(2, this.navigationService.DialogViewKinds.Count); Assert.AreEqual(1, this.navigationService.DialogViewModelKinds.Count); }