private void OpenButton_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { FolderBrowserDialog folderBrowser = new FolderBrowserDialog(); folderBrowser.ShowDialog(); if (string.IsNullOrEmpty(folderBrowser.SelectedPath) == false) { IPresentation presentation = Factory.CreatePresentationReader().ReadAt(folderBrowser.SelectedPath); if (presentation != null) { Resource.FileName = Path.GetFileName(folderBrowser.SelectedPath); Resource.SaveLocation = folderBrowser.SelectedPath.Replace(Resource.FileName, ""); Resource.Presentation = presentation; var window = new PresentationEditor(presentation); window.Show(); Close(); } else { System.Windows.MessageBox.Show("Failed to read presentation"); } } }
private void Button_Click(object sender, RoutedEventArgs e) { var presentationEditor = new PresentationEditor(presentation); presentationEditor.Show(); Close(); }