using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using Venus_MainPages.Sequence; namespace Venus_MainPages.Views { /// /// UserControl1.xaml 的交互逻辑 /// public partial class RecipeSequenceSelectView : Window { private FileNode currentFileNode; public string FullPath { get; private set; } public RecipeSequenceSelectView() { InitializeComponent(); this.buttonOK.IsEnabled = false; } private void buttonCancel_Click(object sender, RoutedEventArgs e) { this.DialogResult = false; } private void buttonOK_Click(object sender, RoutedEventArgs e) { this.DialogResult = true; if (this.currentFileNode != null) { if (this.currentFileNode.IsFile) { this.FullPath = this.currentFileNode.FullPath.Trim(); } } } private void PART_TREE_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) { currentFileNode = (FileNode)PART_TREE.SelectedItem; if(currentFileNode != null) { this.buttonOK.IsEnabled = true; } } private void PART_TREE_MouseDoubleClick(object sender, MouseButtonEventArgs e) { buttonOK_Click(null, null); } } }