Thursday, September 20, 2012 1:19 PM
I have a ‘Grid’, which I’ve split up into 3 rows ( … so I have two ‘RowDefinitions’ slicing up the grid). I’m using a ‘gridSplitter’ so the user can manually extend the contents of the 'middle-row' (it’s a re-sizable help window), works great...
Q: How can I specify the height of one of the grid's ‘RowDefinition’ in my visualstates - so I can jump between a full-screen-state and a minimized-state version (but still allow it to be manually dragged to a halfway position by the user )?
Many Thanks in advance (Apologies for any ambiguity :)
Blend4, WPF, C#
Thursday, September 20, 2012 1:35 PM
... or how would I change it via C# as a last/untidy resort ... MyTopRow.RowDefinitions.Height = new GridLength(49.5); .... ???
:S ... Cheers,
Thursday, September 20, 2012 3:31 PM
I don't know of a way to do it out-of-the-box in VisualStates. There are a couple links here that look promising:
- Marked As Answer by dt01rrj Friday, September 21, 2012 9:00 AM
Friday, September 21, 2012 9:00 AM
Many Thanks for your reply :) ... 99.99% of it was totally over my head :S ... but it did help guide me towards an answer :D
There's no way of producing two different RowDefinition states in the VisualStateManager ... so I've had to incorporate it as a C# snippet ... if it helps I've included the solution below ...
MyPulloutHelpGrid.RowDefinitions.Height = new GridLength(0, GridUnitType.Star);
MyPulloutHelpGrid.RowDefinitions.Height = new GridLength(1, GridUnitType.Star);
['Solution' found at ... http://social.msdn.microsoft.com/Forums/en/wpf/thread/8cde2f7d-9587-4079-bf41-ff107437f3e2 ]
(I'm not sure exactly how it works [it was a bit of trial and error] ... but I think it causes the top row's height to become zero, and the middle row (containing the top edge of my 'help window' and draggable gridSplitter) to fill the full height of the grid [the .Star is just a ratio of how much space the rows take up])
Tuesday, October 02, 2012 4:49 PM
Hello, RJ et al -
I want to do pretty much the same thing, but I am a nonprogrammer who primarily relies on visual states or recording to storyboards to create my interactivity. The C# commands look promising, but can anyone explain to someone who is not a C#/VB developer where they would go? Or if there is a way of accomplishing the same thing via the Blend UI? (I have Blend 4.)