Rob Kraft's Software Development Blog

Software Development Insights

MVVM Rocks! It helped me past a PivotControl bug.

Posted by robkraft on April 24, 2011

MVVM rocks! I thought I would be spending many hours to convert my PivotControl UI to a simple Page UI after I discovered that some PivotControl features don’t work. But the switch took me less than an hour to create 4 new pages and get them all functional. Changing the UI was simple because all of my logic was in my viewmodel. When I bound new forms to my ViewModel to replace the previous PivotControl form, everything just worked. Score a victory for MVVM!
The PivotControl feature that does not work that I needed was the ability to set the Index of the PivotControl and allow the ViewModel to cause navigation to the specified Index. Unfortunately, as of April 2011 in Visual Studio 2010 with Phone 7 it does not matter what value you provide to the SelectedIndex or SelectedItem in the PivotControl, you can only cause the PivotControl to display starting with index zero. I expect this bug will be fixed in the next release of the PivotControl.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: