private void AboutDialogCommand() { IAboutDialogView view = container.GetExportedValue <IAboutDialogView>(); AboutDialogViewModel aboutDialog = new AboutDialogViewModel(view); aboutDialog.ShowDialog(this.shellViewModel.View); }
public void TestAboutDialogVM() { var advm = new AboutDialogViewModel(); Assert.False(string.IsNullOrEmpty(advm.Copyright)); Assert.False(string.IsNullOrEmpty(advm.Version)); }
public AboutController(AboutDialogViewModel ViewModel, IMessenger Messenger) { viewModel = ViewModel; messenger = Messenger; registerMessages(); registerCommands(); }
public AboutDialog BuildWindow() { var aboutDialogViewModel = new AboutDialogViewModel(versionNumber); return(new AboutDialog { Owner = Application.Current.MainWindow, DataContext = aboutDialogViewModel }); }
public void OpenAbout() { var dialog = new AboutDialogViewModel() { Owner = this, Title = "About", }; var result = DialogService.ShowDialog(dialog); if (result == true) { } }
public void GeneralTest() { var view = new AboutDialogView(); var viewModel = new AboutDialogViewModel(view); var owner = new object(); view.ShowDialogAction = v => { Assert.AreEqual(owner, v.Owner); Assert.IsTrue(v.IsVisible); }; Assert.IsFalse(view.IsVisible); bool?dialogResult = viewModel.ShowDialog(owner); Assert.IsFalse(dialogResult.HasValue); Assert.IsFalse(view.IsVisible); }
public void TestInformation() { const string version = "1.0.0"; var applicationVersionProviderMock = new Mock <IApplicationVersionProvider>(); applicationVersionProviderMock .SetupGet(m => m.Version) .Returns(version); var resourceOpeningServiceMock = new Mock <IResourceOpeningService>(); var configuration = new AboutDialogConfiguration { Maintainers = new[] { "Maintainer1", "Maintainer2" } }; var dialog = new AboutDialogViewModel(applicationVersionProviderMock.Object, resourceOpeningServiceMock.Object, configuration); Assert.Equal(version, dialog.ApplicationVersion); Assert.True(configuration.Maintainers.All(dialog.Maintainers.Contains)); }
public void TestOpenRepositoryCommand() { const string url = "url"; var applicationVersionProviderMock = new Mock <IApplicationVersionProvider>(); var resourceOpeningServiceMock = new Mock <IResourceOpeningService>(); resourceOpeningServiceMock .Setup(m => m.Open(url)) .Verifiable(); var configuration = new AboutDialogConfiguration { RepositoryUrl = url }; var dialog = new AboutDialogViewModel(applicationVersionProviderMock.Object, resourceOpeningServiceMock.Object, configuration); Assert.True(dialog.OpenRepositoryCommand.CanExecute(null)); dialog.OpenRepositoryCommand.Execute(null); resourceOpeningServiceMock.Verify(m => m.Open(url), Times.Once); }
private void AboutDialogCommandExcute() { IAboutDialogView view = container.GetExportedValue<IAboutDialogView>(); AboutDialogViewModel aboutDialog = new AboutDialogViewModel(view); aboutDialog.ShowDialog(this.floatingViewModel.View); }
public AboutController(AboutDialogViewModel ViewModel, IMessenger Messenger) { viewModel = ViewModel; messenger = Messenger; }
public AboutDialog() { ViewModel = new AboutDialogViewModel(this); InitializeComponent(); }
public AboutDialog() { DataContext = new AboutDialogViewModel(); InitializeComponent(); }