I have a requirement that my content pane should not be movable, currently user is able to drag the control & move over the form & dock it wherever he want.
So far I have tried following options, but none of them worked.
IsFloating=False
AllowDockingFloating=False
AllowDocking=False
<ig:ContentPanex:Name="WorkspacesPane"IsFloating="False"AllowDockingFloating="False"IsMaximized="False"AllowDocking="False"Header="Workspaces"Location="Left"Height="Auto"Width="Auto"MinWidth="250"IsActivePane="True"CloseButtonVisibility="Collapsed"WindowPositionMenuVisibility="Collapsed">
Please pardon me, but in the sample given there were lot many styles given, I copied them all for my design time control to work.
Here when you say assign the name, to what all styles you are going to assign names & which one you will assign to ModulePane.Style property.
Also to give you more details. I have some kind of host container where controls are added dynamically, in following code this tabgroup has different controls added dynamically.
<ig:TabGroupPane x:Name="StatusModulePane" Location="Bottom" MinHeight="200" Height="200" prism:RegionManager.RegionName="StatusModuleRegion" CloseButtonVisibility="Collapsed" PropertyChanged="StatusModulePane_PropertyChanged">
</ig:TabGroupPane>
Hello cfosterj,
I have been looking into your issue. What I can suggest is to set a Key for the style for the ContentPane. Then when you create the ContentPane you can assign this key to the style proeprty of the ContentPane.
Here is an example:
ContentPane statusModulePane = new ContentPane();statusModulePane.DataContext = statusModuleItem;statusModulePane.Header = statusModuleItem.Header;
statusModulePane.Style = Resources["StyleKey"] as Style;
Please do not hesitate to let me know if you have any further questions on this matter.
Hi Gergana,
That helped for one of my control who was loaded at design time. But for one control it is added dynamically, how would I apply these styles at runtime?
Sample code :
foreach (StatusModuleItem statusModuleItem in statusModuleItems) { if (accessRights.ContainsKey(statusModuleItem.ID)) { long accessRight = accessRights[statusModuleItem.ID];
if (accessRight != Convert.ToInt32(AccessRights.None)) { ContentPane statusModulePane = new ContentPane(); statusModulePane.DataContext = statusModuleItem; statusModulePane.Header = statusModuleItem.Header;
I have been looking into your issue and I have created a small sample application for you. In the sample I have used the default style for the ContentPane. There I set the IsHitTestVisible property of the DockPaneHeader to false. This way the user cannot click on the Header of the ContentPane and can change the content in the pane.
Please find the attached sample application and feel free to let me know if you have any further questions on this matter.
Thanks Gergana. It's inside XamDockManager.Panes. Here is sample Xaml:
<ig:XamDockManager.Panes>
<ig:ContentPane x:Name="WorkspacesPane" IsHitTestVisible="False" AllowDocking="False" DragOver="WorkspacesPane_OnDragOver" Header="Workspaces" Location="Left" Height="Auto" Width="Auto" MinWidth="250" IsActivePane="True" CloseButtonVisibility="Collapsed" WindowPositionMenuVisibility="Collapsed">
<ContentControl prism:RegionManager.RegionName="WorkspacesRegion" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"> </ContentControl> </ig:ContentPane> </ig:XamDockManager.Panes>