locked
Visual States

Answers

  • You're close!

    The minimum size of your app is 500px wide, so your check for (e.NewSize.Width < 500) is never true. Change it to <= and your VisualStateManager.GoToState methods are called:

                if (e.NewSize.Width <= 500) 
                    { 
                        VisualStateManager.GoToState(this, "MinimalLayout", true); 
                    }

    To debug this, put a watchpoint in MainPage_SizeChanged and look at the value of e.NewSize.Width as you size the window to its minimum.

    --Rob

    Monday, April 21, 2014 8:00 PM
    Owner

All replies

  • You're close!

    The minimum size of your app is 500px wide, so your check for (e.NewSize.Width < 500) is never true. Change it to <= and your VisualStateManager.GoToState methods are called:

                if (e.NewSize.Width <= 500) 
                    { 
                        VisualStateManager.GoToState(this, "MinimalLayout", true); 
                    }

    To debug this, put a watchpoint in MainPage_SizeChanged and look at the value of e.NewSize.Width as you size the window to its minimum.

    --Rob

    Monday, April 21, 2014 8:00 PM
    Owner
  • Thanks Rob!!!

    It's now working!!

    Thanks again,

    John


    John Lisenby developer of My PC Playbook

    Monday, April 21, 2014 10:44 PM