示例#1
0
        public ControllerConfigurationViewModel()
        {
            ConfigList = new DirectoryInfo(Directory.GetCurrentDirectory()).GetFiles("*.ControllerConfig");

            DetectControllerCommand = new RelayCommand(
                () =>
            {
                MainViewModel.ScanForControllers();
            },
                () =>
            {
                if (MainViewModel.Robot == null)
                {
                    return(false);
                }
                if (MainViewModel.Robot.Com == null)
                {
                    return(false);
                }
                return(true);
            }
                );

            MainViewModel.Robot.PropertyChanged += Robot_PropertyChanged;
        }
示例#2
0
        public ControllerConfigurationViewModel()
        {
            DetectControllerCommand = new RelayCommand(
                () =>
            {
                MainViewModel.ScanForControllers();
            },
                () =>
            {
                if (MainViewModel.Robot == null)
                {
                    return(false);
                }
                if (MainViewModel.Robot.Com == null)
                {
                    return(false);
                }
                return(true);
            }
                );

            MainViewModel.Robot.PropertyChanged += Robot_PropertyChanged;
        }