Skip to content

Commit

Permalink
Update navigation-history-and-backwards-navigation.md
Browse files Browse the repository at this point in the history
Change the code examples for handling mouse back and forward buttons to move back and forward if the event has not already been handled.
  • Loading branch information
martingbrown authored Jun 8, 2021
1 parent f2dacc2 commit d76dbb0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,12 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e)
{
// For this event, e.Handled arrives as 'true', so invert the value.
if (e.CurrentPoint.Properties.IsXButton1Pressed
&& e.Handled)
&& !e.Handled)
{
e.Handled = !TryGoBack();
}
else if (e.CurrentPoint.Properties.IsXButton2Pressed
&& e.Handled)
&& !e.Handled)
{
e.Handled = !TryGoForward();
}
Expand Down Expand Up @@ -520,12 +520,12 @@ private:
{
// For this event, e.Handled arrives as 'true', so invert the value.
if (e.CurrentPoint().Properties().IsXButton1Pressed()
&& e.Handled())
&& !e.Handled())
{
e.Handled(!TryGoBack());
}
else if (e.CurrentPoint().Properties().IsXButton2Pressed()
&& e.Handled())
&& !e.Handled())
{
e.Handled(!TryGoForward());
}
Expand Down Expand Up @@ -630,12 +630,12 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs e)
{
// For this event, e.Handled arrives as 'true', so invert the value.
if (e.CurrentPoint.Properties.IsXButton1Pressed
&& e.Handled)
&& !e.Handled)
{
e.Handled = !TryGoBack();
}
else if (e.CurrentPoint.Properties.IsXButton2Pressed
&& e.Handled)
&& !e.Handled)
{
e.Handled = !TryGoForward();
}
Expand Down Expand Up @@ -764,12 +764,12 @@ private:
{
// For this event, e.Handled arrives as 'true', so invert the value.
if (e.CurrentPoint().Properties().IsXButton1Pressed()
&& e.Handled())
&& !e.Handled())
{
e.Handled(!TryGoBack());
}
else if (e.CurrentPoint().Properties().IsXButton2Pressed()
&& e.Handled())
&& !e.Handled())
{
e.Handled(!TryGoForward());
}
Expand Down

0 comments on commit d76dbb0

Please sign in to comment.