private void MenuItem_Open_Click(object sender, System.Windows.RoutedEventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = "c:\\"; openFileDialog.Filter = "Project Files (*.aprj)|*.aprj|All files (*.*)|*.*"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; bool?foo = openFileDialog.ShowDialog(); if (foo.HasValue && foo.Value) { LoadProjectFile.Send(openFileDialog.FileName); } }
private void loadButton_Click(object sender, RoutedEventArgs e) { BookManager manager = LoadProjectFile.OpenFromFile(); if (manager != null) { BookManager.SetState(manager); loadButton.Visibility = Visibility.Collapsed; doneLabel.Visibility = Visibility.Visible; rbNewProject.IsEnabled = false; } else { loadButton.Content = "Load"; } }