locked
Behaviors: What to prefer between [Change Property], [Activate State], [Go to State]? RRS feed

  • Question

  • I have been using Expression Blend for several months now, and I am still not clear what should be preferred to simply display or hide subwindows in a screen.

    Use case: I have a specific window that I want to display upon pressing a button that belongs to a user control ("Open") button. Once this window is displayed I want to be able to hide it by clicking a "Close" button that belongs to that window.

    Here is what I have in detail:

    I have a main page (Screen1), and I created a user control (Control1) that has the button "Open" in it. I turned the window into a component screen (ComponentScreen1). I also set 2 states for the component screen: "Shown" and "Hidden". "Shown" sets Visibility to "Visible" and "Hidden" sets Visibility to "Collapsed".

    I placed the elements in Screen1, so that I have on Screen1: Control 1 (that displays the button "Open") and ComponentScreen1.

    Problem is that whatever I do, when I edit the button in the Control1 editing screen, I cannot make the button "Open" have any impact on the display of Component Screen1 in Screen1:
    • if I use [Change Property] behavior for a click on button "Open", there is no choice for me to select the ComponentScreen1 in Screen1
    • if I use [Activate State] behavior, whatever I put in the Target Screen (I tried the component name, everything...), and if I type "Shown" in the TargetState, nothing happens
    • if I use [GoToState] behavior, I cannot select anything that is not in the current control (like in [Change Property] case).
    I assume I should use [Activate State] to make it happen, but there must be something that I don't get, because I cannot make it work.

    Any help out there?

    Thx

    Monday, November 23, 2009 2:43 PM

Answers

  • I have rebuilt my project from scratch and it seems now to work. I use the Activate State behavior, but I made certain not to rename anything anywhere. If I do, then it won't work. Seems like some behaviors don't auto update themselves when you rename some elements...

    What I don't understand is that you have to type the complete path for the name of the screen you are targeting (projectnameScreens.screenname). It's not obvious and is not explicited anywhere that you have to type it this way. Bad UI. I miss a feature that would allow users to select TargetScreen from a Drop-Down populated with the exisiting screens. You shouldn't have to type complex names like that, prone to error.

    Looks like the namings are quite important, I'll ask a specific question about that.
    • Marked as answer by Eric Lagel Tuesday, November 24, 2009 10:07 AM
    Tuesday, November 24, 2009 10:07 AM

All replies

  • I have rebuilt my project from scratch and it seems now to work. I use the Activate State behavior, but I made certain not to rename anything anywhere. If I do, then it won't work. Seems like some behaviors don't auto update themselves when you rename some elements...

    What I don't understand is that you have to type the complete path for the name of the screen you are targeting (projectnameScreens.screenname). It's not obvious and is not explicited anywhere that you have to type it this way. Bad UI. I miss a feature that would allow users to select TargetScreen from a Drop-Down populated with the exisiting screens. You shouldn't have to type complex names like that, prone to error.

    Looks like the namings are quite important, I'll ask a specific question about that.
    • Marked as answer by Eric Lagel Tuesday, November 24, 2009 10:07 AM
    Tuesday, November 24, 2009 10:07 AM
  • I'll give this approach a shot.  I posted a similar sort of problem in another thread that I never got an answer to, so if this works, I'll give you a vote!  :)
    Tuesday, November 24, 2009 3:37 PM
  • Vote 1 for your idea on a drop down list to select screens (and even states). Or at least some type of error checking when you build. As it is, I can build and then sketchflow just crashes. Most annoying !
    Thursday, March 4, 2010 2:59 AM