| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using Prism.Commands;
- using Prism.Events;
- using Prism.Ioc;
- using Prism.Regions;
- using System;
- using System.Windows.Controls;
- using TeamAAS_VP.Models;
- using TeamAAS_VP.ViewModels;
- namespace TeamAAS_VP.Views
- {
- /// <summary>
- /// Interaction logic for SettingView
- /// </summary>
- public partial class SettingView : UserControl
- {
- public SettingView()
- {
- InitializeComponent();
- }
- private void TreeView_SelectedItemChanged(object sender, System.Windows.RoutedPropertyChangedEventArgs<object> e)
- {
- try
- {
- // 获取其 DataContext
- SettingViewModel viewModel = DataContext as SettingViewModel;
- if (e.NewValue is RobotInfo)
- {
- viewModel.SelectRobot = e.NewValue as RobotInfo;
- }
- else if (e.NewValue is FeederInfo)
- {
- viewModel.SelectFeeder = e.NewValue as FeederInfo;
- }
- else if (e.NewValue is CameraInfo)
- {
- viewModel.SelectCamera = e.NewValue as CameraInfo;
- }
- else if (e.NewValue is PlcInfo)
- {
- viewModel.SelectPlc = e.NewValue as PlcInfo;
- }
- }
- catch (Exception)
- {
- }
- }
- }
- }
|