I have a small problem with the field chooser from xam data grid. What i need to do is to change the check / uncheck behavior from double click to one click, which is done here:
<igWPF:LabelPresenter.InputBindings>
<MouseBinding Command="{x:Static igWPF:FieldChooserCommands.ToggleVisibility}" MouseAction="LeftDoubleClick" />
</igWPF:LabelPresenter.InputBindings>
If I change the mouse action from left double click to left click, instead of requiring one less click, it needs one more: Two to select the field, and one to check / uncheck.
Is there anything to do about this, am I doing something wrong?
Hi Rob,
Thank you for the help. With your example we was able to resolve our problem.
Hi dvsegmbh,
I don't think you are doing anything wrong. It seems like the LabelPresenter already uses a single left click for something else so that is interferring with your InputBinding.
In order to deal with this I created a Behavior that attaches to the LabelPresenter in the FieldChooser dialog and when a single click is detected I manually toggle the visibility.
public class ToggleFieldVisibility : Behavior<LabelPresenter> { private LabelPresenter Presenter { get { return this.AssociatedObject; } } protected override void OnAttached() { Presenter.PreviewMouseLeftButtonDown -= Presenter_PreviewMouseLeftButtonDown; Presenter.PreviewMouseLeftButtonDown += Presenter_PreviewMouseLeftButtonDown; } void Presenter_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { var fieldChooser = (FieldChooser)Infragistics.Windows.Utilities.GetAncestorFromType(Presenter, typeof(FieldChooser), false); fieldChooser.ExecuteCommand(FieldChooserCommands.ToggleVisibility, Presenter.Field); e.Handled = true; } }
I attached a sample that demonstrates this.