Welcome to MSDN Blogs Sign in | Join | Help

Updated ExpandoHeaderControl sample for RC0

Here is the updated control sample for RC0.

 Just a few changes from Beta 2 - RCO:

  • generic.xaml needs to now be in a folder called "themes" (case sensitive) rather than in the root of your project. 
  • In VSM transition declarations "Duration" has been renamed to "GeneratedDuration"

So porting was easy.  If you want to play with this, definitely load it up in Blend and check out the great new VSM support as well.  It make re-templating MUCH easier and I had some fun creating weird collapse effects (not included).

 

Published Sunday, September 28, 2008 10:14 PM by sburke
Filed under: ,

Attachment(s): HeaderControl.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# funny wallpaper » Updated ExpandoHeaderControl sample for RC0

# Silverlight Cream for September 29, 2008 -- #382

Boyan Mihaylov on SL/Amazon, David Hyde with SL Stock Portfolio, Chris Anderson with SL LOB app, Jesse

Tuesday, September 30, 2008 2:00 AM by Community Blogs

# re: Updated ExpandoHeaderControl sample for RC0

Hi Shawn, thanks for your update. I created a custom control based on yours and it was fully functional under S2 Beta 2. Unfortunately with RC0 I'm facing one problem.... Is there any way to animate the Height prop of the contentgrid instead of using a rendertransform? The problem is, that I'd like to animate this prop between values Auto (expanded content) to 0 (collapsed content)... Blend claims it is not possible to animate auto generated values. In Beta 2, I used a little workaround to handle this by defining the Storyboard as the layoutRoot grid resource and dynamically setting the Height value in code, after the content was bound and I could evaluate the room it takes. RC0 comes with some changes in VSM syntax/usage and it seems it breaks my bypass :)

Thanks a lot.

Igor    

Tuesday, September 30, 2008 4:55 PM by Igor

# re: Updated ExpandoHeaderControl sample for RC0

@Igor - getting these sorts of things is pretty tough.  I wanted to do this for this control but basically gave up on it and switched to the transform.  There might be some way to push your own transition using the APIs off of VisualStateManager.  One option (hold on to your hat) is to write a control that implements Measure/Arrange based on it's children, then reports that sized value as it's Height.  This would be a container/content control that you'd put your content in and then bind to it's Height property.  Worth trying - but no idea if it'll work or have other side-effects...

Tuesday, September 30, 2008 11:06 PM by sburke

# re: Updated ExpandoHeaderControl sample for RC0

Shawn, as I can see we've come across similar issues and ideas how to handle them. :) I've played a bit with such custom panel but with no desired output so far. I've managed to work things out in Beta 2 with this little named static resource trick. I've also implemented your approach in my custom control with success (working on RC0), although it's not the kind of effect I'm looking for, as I've incorporated your control idea and have created a HeaderedItemsControl (HIC), which contains a header and collapsible list of items. Moreover, I've created a list of these controls, which is the main reason why I can't use your RenderTransform approach. I need all HICs in the list below the selected one to move up/down as I expand/collapse the selected HIC accordingly. The layout is not affected when playing with render transformation, as far as I know...that's why I need to play with the panel height instead. Result for me? : I'll probably play with the custom panel a bit more. BTW Have you some best practices or samples of custom panels overriding Measure/Arrange methods available? Thanks a lot

Wednesday, October 01, 2008 6:09 AM by Igor

# re: Updated ExpandoHeaderControl sample for RC0

I'm having the same issues. Still no luck?

Wednesday, October 08, 2008 2:50 AM by Miguel Madero

# re: Updated ExpandoHeaderControl sample for RC0

David has written about some of this stuff at his blog:

http://blogs.msdn.com/delay/

Wednesday, October 08, 2008 2:18 PM by sburke

# re: Updated ExpandoHeaderControl sample for RC0

Thank you for pointing out the reference to David's LayoutTransform project. It looks it may provide me with solution to my issues. I'll definitely take a closer look at the project and will also play a bit with that custom Panel in advance ... just to see what can we do about it. If something interesting comes out, I'll let you guys know about it.

Cheers

Tuesday, October 14, 2008 3:46 PM by Igor

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker