eberthold
eberthold

Reputation: 171

Strange navigation Winrt/C#

i've encountered a very strange behavior in navigating from one page back to another. Maybe someone has a clue what could be the reason, because I have no idea ;)

Technology: Universal App for Windows (Phone) 8.1 whith XAML/C#

So what happens is:

  1. The user navigates forward from one page to another.
  2. The old page is set to NavigationCacheMode.Required, because it should preserve it's state and data.
  3. Now if navigating back by clicking the "UI Back Button" with the Mouse (Windows) or the Physical Back Button (Windows Phone) it works like expected. If the user clicks the "UI Back Button" on Windows via touch input something goes wrong which doesn't raise any errors, or is even debugable for me right now.

The strange facts are:

  1. The click event is fired and Frame.GoBack() is called
  2. OnNavigatingFrom() and OnNavigatedFrom() is also called, as is OnNavigatingTo() on cached page
  3. But the View reamins unchanged, and i can interact with the page displayed as well

Even more irritating is: If the same navigation was first done with mouse input and later done by touch, it works like a charm.

It is reproducible on Surface RT 1 & 2, and also on Dell Inspiron 15 with touch input.

No Code included, because i'am doing nothing special in named events or mehtods, so it's the plain standard frame navigation from WinRT

I'm thankful for every idea which could lead me to the reason

Upvotes: 0

Views: 158

Answers (1)

eberthold
eberthold

Reputation: 171

After spending some hours in debugging plus trial & error, it turns out there is a problem on my source page (the one I try to navigate back to). It contains a horizontal list with nested vertical lists, both using some kind of virtualizing panel (ItemsStackPanel and ItemsWrapGrid)

After scrolling any of the nested vertical lists, which happens inital to show the correct item, the bug occurs. When removing the initial scroll, everything works fine until the user has scrolled manually. It seems that some kind of UI lock is set, which prevents the navigation of the frame.

A solution which does it's job, is replacing the panel of all inner lists with non-virtualizing panels. But that's no option for me, as performance is important and there can be huge data to display. So i will end up writing a complete custom solution for that view.

As this is not the first bug i encountered with ItemsStackPanel and ItemsWrapGrid, i only can recommend not using them until you have a simple plain list with only one item type in it. Hope MS will fix them in later releases of OS/SDK

Upvotes: 1

Related Questions