private void CommandText_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { ExecuteButton.PerformClick(); } }
void ReleaseDesignerOutlets() { if (GuidLabel != null) { GuidLabel.Dispose(); GuidLabel = null; } if (InvokeButton != null) { InvokeButton.Dispose(); InvokeButton = null; } if (ExecuteButton != null) { ExecuteButton.Dispose(); ExecuteButton = null; } if (BindButton != null) { BindButton.Dispose(); BindButton = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); ViewModel = new TestViewModel(); this.WhenActivated(d => { InvokeButton.Events().TouchUpInside .Log(this, nameof(InvokeButton)) .Select(_ => Unit.Default) .InvokeCommand(this, view => view.ViewModel.GenerateNewGuid) .DisposeWith(d); ExecuteButton.Events().TouchUpInside .Log(this, nameof(ExecuteButton)) .SelectMany(_ => ViewModel.GenerateNewGuid.Execute()) .Subscribe() .DisposeWith(d); this.BindCommand(ViewModel, vm => vm.GenerateNewGuid, view => view.BindButton) .DisposeWith(d); this.OneWayBind(ViewModel, vm => vm.NewGuid, view => view.GuidLabel.Text) .DisposeWith(d); this.WhenAnyObservable(view => view.ViewModel.GenerateNewGuid.CanExecute) .Take(1) .Where(canExecute => canExecute) .Log(this, nameof(ViewModel.GenerateNewGuid.CanExecute)) .Select(_ => Unit.Default) .InvokeCommand(this, view => view.ViewModel.GenerateNewGuid) .DisposeWith(d); // This doesn't make a difference, but to avoid the POCO message /* * ViewModel.GenerateNewGuid.CanExecute * .Take(1) * .Where(canExecute => canExecute) * .Log(this, nameof(ViewModel.GenerateNewGuid.CanExecute)) * .Select(_ => Unit.Default) * .InvokeCommand(this, view => view.ViewModel.GenerateNewGuid) * .DisposeWith(d); */ }); }
public void ExecuteSwitchSpec() { ExecuteButton.Click(); for (int i = 0; i < 2; i++) { Window.HandleModelWindow(win => { HandlePenetrationCorrectionOptions(win, PenetrationCorrectionOptions.None); win.ClickOK(); return(true); }); Window.HandleModelWindow(win => { HandleWeightedFieldsSpec(win); win.ClickOK(); return(true); }); WaitExecuteWindow(); } var viewer = UITools.GetProcessBlock("Viewer")[0]; viewer.Kill(); return; }
/// <summary> /// Execute Button will be clicked on /// </summary> public void ClickOnExecuteButton(string text) { ExecuteButton.Click(); WaitWhileTextToBePresentInElement(FieldWithResultOfCompilationCode,text); }