Brian Genisio's House of Bilz

  Home  |   Contact  |   Syndication    |   Login
  72 Posts | 0 Stories | 186 Comments | 0 Trackbacks

News

Locations of visitors to this page

Archives

Post Categories

Who am I?

I am currently working on a multi-touch application using WPF.  One thing that has been irritating me with this development is an automatic navigation forward/back command that is bound to forward and backwards flicks.  Many of my touch-based interactions were being thwarted by gestures picked up by WPF as navigation.  I just wanted to disable this behavior.

My programmatic back/forward calls are not affected by this change, which is nice.  Here is how I did it:  In my main window, I added the following command bindings:

<NavigationWindow.CommandBindings>
    <CommandBinding Command="NavigationCommands.BrowseBack" Executed="DoNothing" />
    <CommandBinding Command="NavigationCommands.BrowseForward" Executed="DoNothing" />
</NavigationWindow.CommandBindings>

Then, the DoNothing method in the code-behind does nothing:

private void DoNothing(object sender, ExecutedRoutedEventArgs e) { }



There may be a better way to do this, but I haven’t found one.

posted on Wednesday, June 02, 2010 4:10 AM

Feedback

# re: Disabling Navigation Flicks in WPF 6/7/2010 12:40 AM nitzzzu
Or in the constructor of your NavigationWindow:

NavigationCommands.BrowseBack.InputGestures.Clear(); NavigationCommands.BrowseForward.InputGestures.Clear();

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: