locked
Device Panel View and Visual State interaction

    Question

  • Does this seem like a bug? If you choose one of the View avatars on the Device Panel it updates the Visual State. But if you update the Visual State, it doesn't update the View avatar.

    If it is a bug, it's a trivial one, but I'm always hesitant to jump to the "bug" conclusion if there might be a reason for some behavior...?


    Rebecca M. Riordan


    Tuesday, February 19, 2013 3:48 PM

Answers

  • No, it is not a bug, but I agree that the behavior could be a bit confusing.

    The concept of states is a generic one, and one of the use cases is for View States are you are observing. If you toggle the states via the States panel, that is akin to doing it even if View States were not involved.

    In the case of the Device Panel, we know for a fact that the state name to be activated is a particular one (because you are using LayoutAwarePage that has these state names baked in). Hence we transition to the state.

    Hope that helps.

    Thanks,
    Unni


    Unni Ravindranathan, Program Manager, Visual Studio and Blend This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, February 22, 2013 7:06 AM

All replies

  • No, it is not a bug, but I agree that the behavior could be a bit confusing.

    The concept of states is a generic one, and one of the use cases is for View States are you are observing. If you toggle the states via the States panel, that is akin to doing it even if View States were not involved.

    In the case of the Device Panel, we know for a fact that the state name to be activated is a particular one (because you are using LayoutAwarePage that has these state names baked in). Hence we transition to the state.

    Hope that helps.

    Thanks,
    Unni


    Unni Ravindranathan, Program Manager, Visual Studio and Blend This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, February 22, 2013 7:06 AM
  • Ah, so there are (at least potentially) View States that don't map to Views. Of course, how sensible. Do you happen to know whether the list of view states is picking them up from the VisualStateManager, or are they hard-coded? (I'll have a play at some point, but if you already know...)

    Rebecca M. Riordan

    Friday, February 22, 2013 1:17 PM
  • They are mapped in LayoutAwarePage.cs.

    Thanks,
    Unni


    Unni Ravindranathan, Program Manager, Visual Studio and Blend This posting is provided "AS IS" with no warranties, and confers no rights.

    Monday, February 25, 2013 7:38 AM
  • Sorry, Unni, my last question was badly phrased. I meant to ask how much was being set up when the page is loaded. Obviously the Device Panel knows that the curerent page has the standard docking states, but would it know, for example, if a custom page added additional states to that group?

    As I said, it's easy enough to check when I get a minute (sometime next year, I think), but I thought you might just now.


    Rebecca M. Riordan

    Monday, February 25, 2013 12:52 PM