Changes to FrameAdapter

Topics: Bugs
Aug 31, 2011 at 5:16 AM

Hey Rob,

Since using CM when it was first introduced I've always manually swapped 2 lines of code and completely forgot to suggest it to you.

In INavigationService.cs, the FrameAdapter.OnNavigated method on line 154, I reverse the order of 2 calls:

ViewModelBinder.Bind(viewModel, page, null);

TryInjectQueryString(viewModel, page);

becomes

TryInjectQueryString(viewModel, page);

ViewModelBinder.Bind(viewModel, page, null);

I find that if I inject the query string BEFORE the rest of the binding I resolve a lot of null reference exceptions, since technically I want all my scalar querystring properties to be available before I start the more intensive binding.

Hopefully this will not break any existing code, let me know if you have any objections to changing the source, so I won't have to manually anymore ;)

-Matt