RecipeSequenceSelectView.xaml.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Collections.ObjectModel;
  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.Navigation;
  15. using System.Windows.Shapes;
  16. using Venus_MainPages.Sequence;
  17. namespace Venus_MainPages.Views
  18. {
  19. /// <summary>
  20. /// UserControl1.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class RecipeSequenceSelectView : Window
  23. {
  24. private FileNode currentFileNode;
  25. public string FullPath { get; private set; }
  26. public RecipeSequenceSelectView()
  27. {
  28. InitializeComponent();
  29. this.buttonOK.IsEnabled = false;
  30. }
  31. private void buttonCancel_Click(object sender, RoutedEventArgs e)
  32. {
  33. this.DialogResult = false;
  34. }
  35. private void buttonOK_Click(object sender, RoutedEventArgs e)
  36. {
  37. this.DialogResult = true;
  38. if (this.currentFileNode != null)
  39. {
  40. if (this.currentFileNode.IsFile)
  41. {
  42. this.FullPath = this.currentFileNode.FullPath.Trim();
  43. }
  44. }
  45. }
  46. private void PART_TREE_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
  47. {
  48. currentFileNode = (FileNode)PART_TREE.SelectedItem;
  49. if(currentFileNode != null)
  50. {
  51. this.buttonOK.IsEnabled = true;
  52. }
  53. }
  54. private void PART_TREE_MouseDoubleClick(object sender, MouseButtonEventArgs e)
  55. {
  56. buttonOK_Click(null, null);
  57. }
  58. }
  59. }