Hi
I have a XamTabControl inside a DockManager as a SplitPane.
I have the Pane unpinned ready and waiting for the user to hover over for access.
Within the Tab Control I have 2 tabs, 1 a natural height of 200 and the other of 1000.
Because we have the natural size to content, selecting 1 tab is ok, selecting the other expends the whole thing to the screen.
I can set MaxHeight, MinHeight, etc which works, but if the user then drags the splitter bar it will not resize the content (as we have put Height values on it)
Any suggestions ?
cheers
Martin
Before you drag the splitter, the Height of the SplitPane is double.NaN (i.e. unspecified) so the height of the SplitPane is based on its desired size which essentially is based on the content. Once you drag the splitter though we have to change the Height of the splitter so we can honor the split height that the user has specified. What is the behavior that you would expect once the user drags the splitter?
thanks
Once the splitter has been altered I would like the contents of the spliter to ignore their own size and work off the splitter
Or to put it another way, when dragged the splitter should to ignore the set size of the content and resize them
I need something like InitialHeight, used when loaded but can be ignored.
Are there feedback events from the Resizeing of the splitter? (I tried SplitPane.SizeChanged but nothing)
If you don't want the splitpane to change size when you change tabs then you can set the Height property of the root SplitPane. By default the Height is double.NaN and the size will be based on the size of the content.
Thanks for that, its a great example and I am sure it will be enough to work it out.
Below is your example but I have changed it into the way I am using it. It is 1 Dockable panel with a TabControl inside it.
What I dont want is the dock panel to change size when uses selected different Tabs, at the moment the size changes with each tab selection, as soon as the splitter is used everything works fine, your solution also works great now to allow it to resize (where MaxHeight stopped it working)
A UK phrase we say is "I want my cake and eat it" :-)
thanks for your help
<Window x:Class="XamDockManagerTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:XamDockManagerTest" xmlns:igDock="http://infragistics.com/DockManager" xmlns:igWindow="http://infragistics.com/Windows" Title="Window1" Height="500" Width="700"> <igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom"> <igDock:ContentPane Header="Foo" IsPinned="False" > <igWindow:XamTabControl>
<igWindow:TabItemEx Header="Small Item"> <local:PreferredSizeDecorator PreferredHeight="200"> <Button Content="This is small" /> </local:PreferredSizeDecorator> </igWindow:TabItemEx>
<igWindow:TabItemEx Header="Big List"> <local:PreferredSizeDecorator PreferredHeight="200"> <ListBox x:Name="list" /> </local:PreferredSizeDecorator> </igWindow:TabItemEx> </igWindow:XamTabControl> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager></Window>
Well the PaneSplitter is a Thumb so it will bubble a DragCompleted event but there are a few issues with that. First, the splitter doesn't indicate which pane(s) were affected but you could get around that by just iterating the root Panes collection and traversing any that have an explicit Width/Height based on the Orientation of the splitter. The other issue about this kind of approach though is when else you might need to do this. For example, if a CP is unpinned then it won't be in that SplitPane but it will be once you repin it and if it is in a SplitPane that has an explicit width then you need to know to remove your constraints on that content. Another similar scenario would be if you were to drag a pane from a Split that didn't have an explict width to one that had an explicit width (or vice versa).
Can I assume that you're setting a MaxHeight because you have some itemscontrol, etc. that would result in it being too tall when sized with an infinite height (as would happen when within a unsized SplitPane, in a ScrollViewer, etc.)? If so then perhaps you just need to create a wrapper element that will constrain the measure size of that control without setting the MaxWidth|Height. I've attached a simple sample that does this.