views:

169

answers:

2

I'm looking to extend the GridSplitter in some way to add a button which when click expands or collapses the control to one of the specified sides of the splitter.

I've found a solution that works for Silverlight 4 but I need this to work for standard WPF in .NET 3.5 which means that the GridSplitter doesn't implement the Visual State Manager stuff that is used in Shemesh's solution. Other than it won't work for WPF in .NET 3.5 I think Shemesh's solutions is probably exactly what I'm looking for with smooth animated transitions and remembering the last expanded size upon expanding from a collapsed state.

Anybody have any examples of this being done in regular WPF?

+1  A: 

Here is a example of how to do it: http://www.rudigrobler.net/Blog/doubleclickcollapsegridsplitterbehavior

But... It only does collapsing and there is no animations (It also has no button but can be added easily)

rudigrobler
I'm looking for a solution that is compatible with plain vanilla WPF and .NET 3.5 SP1. The only dependency that I can accept is reliance on the latest version of the WPF Toolkit.
jpierson
This will work in .NET 3.5 SP1... Just convert it to a attached property (Attached behavior)
rudigrobler
A: 

Ok, I've tinkered with the Silverlight example enough to get something working for .NET 3.5 SP1 and the WPF Toolkit February release for the Visual State Manager stuff. Below you can find the two main source files that I've fixed, refactored, and reorganized quite a bit.

The solution is to big to post on StackOverflow so please see my blog post that has the code snippets you will need.

jpierson