/// <summary>Create a control where the user can select the key they wish to detect.</summary> public Visual GetControl(Application application) { var c = new Controls.Control_FieldPresenter { Type = typeof(Keys), Margin = new System.Windows.Thickness(0, 0, 0, 6) }; c.SetBinding(Controls.Control_FieldPresenter.ValueProperty, new Binding("TargetKey") { Source = this, Mode = BindingMode.TwoWay }); return(c); }
/// <summary>Create a control where the user can select the key they wish to detect.</summary> public Visual GetControl(Application application) { StackPanel panel = new StackPanel(); var c = new Controls.Control_FieldPresenter { Type = typeof(Keys), Margin = new System.Windows.Thickness(0, 0, 0, 6) }; c.SetBinding(Controls.Control_FieldPresenter.ValueProperty, new Binding("TargetKey") { Source = this, Mode = BindingMode.TwoWay }); panel.Children.Add(c); StackPanel time = new StackPanel(); time.Orientation = Orientation.Horizontal; var text = new TextBlock(); text.Text = "For"; time.Children.Add(text); c = new Controls.Control_FieldPresenter { Type = typeof(float), Margin = new System.Windows.Thickness(5, 0, 5, 6) }; c.SetBinding(Controls.Control_FieldPresenter.ValueProperty, new Binding("Seconds") { Source = this, Mode = BindingMode.TwoWay }); time.Children.Add(c); text = new TextBlock(); text.Text = "Seconds"; time.Children.Add(text); panel.Children.Add(time); return(panel); }