コード例 #1
0
        private void Page_KeyDown(object sender, KeyEventArgs e)
        {
            SettingsPageViewModel vm = this.DataContext as SettingsPageViewModel;

            if (vm == null)
            {
                return;
            }

            switch (e.Key)
            {
            case Key.F1:
                vm.SetInputCommand.Execute(true);
                break;

            case Key.F2:
                vm.SetInput2Command.Execute(true);
                break;

            case Key.F5:
                vm.AutoClickCommand.Execute(true);
                break;

            default:
                break;
            }
        }
コード例 #2
0
        public SettingsPage()
        {
            InitializeComponent();
            SettingsPageViewModel vm = new SettingsPageViewModel(this);

            this.DataContext = vm;
        }
コード例 #3
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            SettingsPageViewModel vm = this.DataContext as SettingsPageViewModel;

            if (vm == null)
            {
                return;
            }

            var selected = (sender as ComboBox).SelectedIndex;

            vm.ChangeClickTypeCommand.Execute(selected);
        }