C++/XAML: Determining the view state or orientation of your Windows 8

How hard is it to use the VisualStateManager Animations with your view states?  Not very hard. 

In Windows 8.1 the ApplicationViewState enumerations are going to be deprecated in 8.1 and onward you will need to query for the Windows Size directly.  I will cover this when I get my 8.1 machine back from the tech guy.  The changes are relatively painless and allows you to use the cool feature to have up to four apps across the screen without your system freezing.  Which in August, 2013 seems like a good idea with the usual August temperatures. Or is that the hysterical climate change excessive heat?  Never sure which one to say.

Windows 8

In Windows 8 the MainPage has an event that fires when there is a size changed:

void MainPage::OnWindowSizeChanged(CoreWindow^ sender,  WindowSizeChangedEventArgs^ args)
{
     if (ApplicationView::Value == ApplicationViewState::Snapped)
     {
         VisualStateManager::GoToState(this->LayoutControl, "SnappedState", true);
     }
     else
     {
         VisualStateManager::GoToState(this->LayoutControl, "UnsnappedState", true);
     }

}

As you can tell from the previous blog, with the video that shows you how to use Blend to create the Visual States.  You create the animations for the different states: Snapped, and so forth.

Windows 8.1

Can’t test 8.1 solutions till I get my Windows 8.1 machine back from the shop.  Nothing serious, mostly too lazy to drive over to Irvine to get it.  But have to meet with manager tomorrow and will get it on the way home.