Navigate.xaml.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using Microsoft.Win32;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. namespace OpenAndSaveDialogFile
  16. {
  17. /// <summary>
  18. /// Логика взаимодействия для Navigate.xaml
  19. /// </summary>
  20. public partial class Navigate : Window
  21. {
  22. public Navigate()
  23. {
  24. InitializeComponent();
  25. }
  26. private void btnNavigate_Click(object sender, RoutedEventArgs e)
  27. {
  28. var dlg = new OpenFileDialog();
  29. dlg.Filter = "txt file (*.txt) | *.txt|all files |*.*";
  30. Nullable<bool> result = dlg.ShowDialog();
  31. if (result == true)
  32. {
  33. MainWindow main = new MainWindow(dlg.FileName);
  34. main.Show();
  35. this.Close();
  36. }
  37. }
  38. }
  39. }