How about using the FluidLayout behavior from Blend? http://msdn.microsoft.com/en-us/library/ee341455(Expression.30).aspx
First setup the Grid with the 4x4 rows/cols. <http://msdn.microsoft.com/en-us/library/ee341455(Expression.30).aspx>Then create two visual states: The first state will be your Grid with the child items arranged (by the sounds of it) in some sort of "stacking" layout. The second state will be your Grid with the child items arranged, with each item in one of the 16 grid cells. Then when you switch Visual State the layout will change. Activate the FluidLayout by clicking the little wave icon in the States window, and set the default transition to 1sec - if previews are enabled, as you toggle between visual states you should get smooth animated transitions. Note: If you are literally adding/removing items from the panel you will need to make sure that the items defined in the visual state are permanent i.e. you may need to place each "child control" into a container such that it is always present in the Grid. Do you already animate the push? Cheers, Jack On Mon, Dec 6, 2010 at 4:43 PM, Greg Keogh <[email protected]> wrote: > This question is related to Silverlight and WPF, as I may need to use this > technique in both sorts of apps. > > > > My app’s main <Grid> parent control can contain different types of child > controls that display data in various ways. I internally maintain a 16-deep > List<> of the children, I push a new child onto the top and make it visible, > the others are pushed down and hidden and the oldest one drops off the end > when it’s full. So I effectively have an MRU list of up to 16 child controls > available. > > > > When the user hits a hotkey I want make all of the children visible and > tile them in a nice 4 x 4 arrangement as thumbnails. > > > > I’m just not sure what the best mechanism is to achieve this. At first I > thought I’d do it manually: centre-position and scale transform each child > to create a fake tiled arrangement and maintain it on size changes. > > > > Before I do this manual coding, I thought I’d ask for ideas about better > techniques. > > > > Cheers, > > Greg > > _______________________________________________ > ozsilverlight mailing list > [email protected] > http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight > >
_______________________________________________ ozsilverlight mailing list [email protected] http://prdlxvm0001.codify.net/mailman/listinfo/ozsilverlight
