Mike Taulty's Blog
Bits and Bytes from Microsoft UK
Blend Bits 13: Fluid Layout and the Popup Panel

Blogs

Mike Taulty's Blog

Elsewhere

Archives

This comes directly from something that I was doing today with Blend. Let’s imagine that I have a UI like this one;

image

and I have it set such that when my mouse enters the scene, that little grid at the bottom animates in from the bottom and when my mouse leaves the scene it animates out;

image

I put this together in the simplest way possible. My layout looks like this;

image

and the sneaky thing is that I have 3 rows rather than 2. That bottom row is set to size 0.

When the mouse leaves the control, I move the content of Grid Row 2 to Grid Row 3 where its height becomes 0 and it disappears.

When the mouse enters the control, I move the content of Grid Row 3 to Grid Row 2 where it has height and appears.

I do that via visual states.

image

image

and the only difference between these 2 states is that in one state I have content set to Grid.Row=1 and in the other it’s Grid.Row=2.

Now, I want a nice, smooth transition between these states so I switch on Fluid Layout in Blend 4;

image

which makes that work for me and I can also set up how long the transition takes, an easing function to apply and any transition to use. I can also preview that in the environment by switching on the preview;

image

Naturally, to make this then happen on MouseEnter/MouseLeave I just need to use the appropriate GoToStateAction and I have 2 setup on my root control here;

image

and, as an example, one of those looks like;

image

and I’m done Smile


Posted Mon, Sep 27 2010 2:21 PM by mtaulty

Comments

Raghuraman wrote re: Blend Bits 13: Fluid Layout and the Popup Panel
on Mon, Sep 27 2010 8:29 PM

Hi Mike,

Thank you very for the Blend Bits. I have followed it up on my iphone everytime but could not comment earlier.

This is very refreshing and useful to even mid-level-silverilght professionals like me.

Regards

KRK

DotNetShoutout wrote Blend Bits 13 Fluid Layout and the Popup Panel - Mike Taulty
on Wed, Sep 29 2010 11:37 AM

Thank you for submitting this cool story - Trackback from DotNetShoutout

Mike Taulty's Blog wrote Blend Bits 23–Templating Part 1
on Fri, Feb 11 2011 2:47 PM

One of the real strengths of Expression Blend is in its deep understanding of control templates. Visual