locked
Help with FluidMoveBehavior (or similar) RRS feed

  • Question

  • I have the need to setup a scene in my Silverlight 4 application that must behave as follows:

    the screen (full-screen 4x4 grid, or listbox/wrappanel, not sure which one yet) starts off showing nothing.

    When a user clicks a button, a custom control (but for now lets just use a rectangle) is added to the screen stretched full width and height (animated if possible)

    The next button click adds another rectangle to the screen and now the two rectangles take up half the screen's width (two side-by-side rectangles full height)

    The next button click adds another rectangle (and this is where it gets tricky). I want the first two rectangles to shift up to the top row of the screen (take up the top left and top right sections of the screen) and the new rectangle to be in the bottom left side (leaving one free spot in the bottom right).

    The next button click adds another rectangle to the screen and takes up the remaining space in the bottom right corner.

    Then, if the user clicks again, the first rectangle (in the top left corner) needs to be removed, and the rest of the rectangles shift along accordingly, 2nd goes to 1st, 3rd goes to 2nd, 4th goes to 3rd and the new one goes to 4th.

    Thats it for the adding, but now just imagine that we need to also support removing any of the rectangles at any time and the app should shift along accordingly.

    Does this all make sense?

    I was looking into the FluidMoveBehavior stuff but cannot get it right...

    Any help here is greatly appreciated

    -- Mark

    Wednesday, November 3, 2010 4:21 AM

All replies

  • This sounds like you will want to write your own custom panel to manage the layout for you. It sounds similar to the wrappanel control in the SL toolkit. I would suggest you download the source for that as a starting point:

    http://silverlight.codeplex.com/

    Wednesday, November 3, 2010 1:36 PM
    Moderator
  • Hello Mark,

    additionally you might want to refer to a perhaps helpful video series from Jose Fejardo about "The Power of States in Blend 3". He describes a very powerful workflow, that I guess should help you exactly in your scenario. The videos were made for Blend 3 but the technique is the same with Blend 4.

     

    Thursday, November 4, 2010 11:40 AM