I have a application with a xamDockManager and in it I've put a single ContentPane. That ContentPane is rendered correclty, but the close button is disabled, even if I set AllowClose="true" manually. This is my xaml code for this
<
igDock:XamDockManager x:Name="startupManager"
VerticalAlignment="Stretch" Grid.Row="1"
Background="Black">
<igDock:ContentPane Header="Welcome" AllowClose="True">
<Grid>
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="24" FontWeight="Bold" Foreground="Red">WELCOME USER</TextBlock>
</Grid>
</igDock:ContentPane>
Can anyone explain this? Is invalid to put a ContentPane directly on a xamDocManager?
Thanks
</igDock:XamDockManager
>
Hi hadrian625,
The problem is that the ContentPane is not a part of XamDockManager.Panes.
Putting the following tags after <igDock:XamDockManager ..... >:
<igDock:XamDockManager.Panes>
<igDock:SplitPane>
<igDock:ContentPane x:Name="yourContentPane" />
</igDock:SplitPane>
</igDock:XamDockManager.Panes>,
should resolve the issue.
Hope this helps.
I tried already this solution, but in this case the ContentPane does not ocupy the all available width and I did not find a solution to this problem.
In this case you may either set the XamDockManager's LayoutMode property to 'FillContainer' (if you're using NA for WPF 10.1 or later), or bind your ContentPane's width to the ActualWidth of the XamDockManager:
< igDock:ContentPane Header="Pane1" Width igDock:ContentPane Header="Pane1" Width igDock:ContentPane Header="Pane1" Width igDock:ContentPane Header="Pane1" Width
igDock:ContentPane Header="Pane1" Width
="{Binding ElementName=xamDock1, Path=ActualWidth}" />.
If I do this, the content pane resizes only the first time, after that, once I am resizing the window the xamDockManager resizes correctly, but the ContentPane remains at the same width. Also in this combination, with contentPanse in SplitPane the user can resize the SplitPane, which is not acceptable in my situation.
Sorry for the previous not helping posts.
With regard to forbidding the SplitPanes resizing you need to disable the proper splitters. For further information, please check out the following post:
http://community.infragistics.com/forums/p/35996/221724.aspx
Here's the solution I found at my end:
<igDock:XamDockManager x:Name="xamDock1">
<igDock:XamDockManager.Resources>
<Style TargetType="igDock:SplitPaneSplitter">
<Setter Property="IsEnabled" Value="False" />
</Style>
<Style TargetType="igDock:DockedPaneSplitter">
</igDock:XamDockManager.Resources>
<igDock:SplitPane x:Name="sp1" >
<igDock:ContentPane x:Name="cp1" Header="Pane1" Width="{Binding ElementName=xamDock1, Path=ActualWidth, Mode=OneWay}" >
</igDock:XamDockManager.Panes>
</igDock:XamDockManager>
In this manner I got the ContentPane resize along with the window resizing.
I tried your solution, but I can still drag and dock the content pane on the left side, even if I put AllowDocking to false (also I put all other Allow...Docking properties ti false). With this docking the pane can now be resized automatically to just a portion of the xamDockManager, which is not acceptable for my case. My pane should be an welcome screen for my application
In order to completely forbid dragging the pane what you could do is cancel the XamDockManager's PaneDragStarting event. This way dragging and therefore docking would not be an option for the users.