public async void CreateJournal() { if (Password == ConfirmPassword) { var journal = new Journal(); var dialog = new SaveFileDialog(); dialog.Filters.Add(new FileDialogFilter() { Extensions = new List <string>() { "osj" }, Name = "Open Secure Journals" }); var result = await dialog.ShowAsync(new Window()); if (result != null) { await JournalFileService.SaveJournal(result, journal, Password); var vm = new JournalControlViewModel(); vm.Journal = journal; MainContentHelper.MainWindowViewModel.MainContent = new JournalControl() { DataContext = vm, }; ParentWindow.Close(); } } }
public async void UnlockJournal() { var journal = await JournalFileService.OpenJournal(JournalPath, Password); var vm = new JournalControlViewModel(); vm.Journal = journal; MainContentHelper.MainWindowViewModel.MainContent = new JournalControl() { DataContext = vm, }; ParentWindow.Close(); }