I have an application where I am using the xamDock manager that takes up the whole screen but I would like the orientation as follows.
Top of the screen
---------------
Pane 1 (takes up width of the whole screen)
----------------
Pane 2 (half of the width screen) | Pane 3 (half of the width screen)
-----------------
Pane 4 (takes up width of the whole screen)
------------------
Pane 5 (half of the width screen) | Pane 6 (half of the width screen)
--------------------
Bottom of the screen
Is this achievable? Initial location only seems to respond to DockedBottom, DockedRight, DockedLeft, and DockedTop. How would I express "Docked BottomRight" for example, please?
Hello Christian,
To achieve the desired layout of the panes in the DockManager, I have added four SplitPanes to it. If you set each SplitPane’s original location to DockedTop, they will all be the width of the screen, and they will all dock directly under one another. Then, you can set the height of the SplitPane and add the desired number of content panes to each.
I have attached a sample project to demonstrate.
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewDeveloper Support IInfragistics Inc.www.infragistics.com/support
is this the correct syntax if I wish to add content to the content pane dynamically from viewmodel?
<igWPF:SplitPane igWPF:XamDockManager.InitialLocation="DockedBottom" SplitterOrientation="Horizontal" AllowDrop="True">
<igWPF:ContentPane x:Name="bottomDock" prism:RegionManager.RegionName="{x:Static inf:KnownRegionNames.DockedBottom}" />
</igWPF:SplitPane>
...
private
void OpenPositionSummary()
{
var view = _container.Resolve<PositionSummaryView>();
view.DataContext = _container.Resolve<PositionSummaryViewModel>();
var region = RegionManager.Regions[KnownRegionNames.DockedBottom];
region.Add(view);
region.Activate(view);
}
I Get the following error when I try it this way (PositionSummaryView.xaml is a ContentPane) ...
"ContentPane 'Modules.InventoryManagement.PositionSummaryView Header:Position Summary Content:' cannot be nested within another ContentPane ('Infragistics.Windows.DockManager.ContentPane Header: Content:Position Summary')"
Should I change PositionSummary to be something other than a content pane?
You should be able to add one view to the content pane using code similar to the code you provided that your PositionSummaryView is a UserControl and not a ContentPane. If you wish to add multiple ContentPanes using prism, I suggest reviewing the following posts:
http://brianlagunas.com/xamdockmanagera-prism-regionadapter/
http://es.infragistics.com/community/blogs/blagunas/archive/2013/03/16/xamdockmanager-an-updated-prism-region-adapter.aspx
Also, I tested your approach in the attached sample and my view was added to the region successfully. If you still need assistance after reviewing the posts, please check the attached sample and if needed modify the sample to better effect your scenario or provide an alternate sample demonstrating your issue so that I can be of further assistance.
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Were you able to resolve your issue?
Do you have any other questions on this matter?
Sincerely,Valerie Developer Support Supervisor - XAMLInfragisticswww.infragistics.com/support
RegionManager is the name of a class and Get/SetRegionManager are static methods on this class. These methods are what you use to get/assign IRegionManagers to DependencyObjects like controls. Sorry for the confusion.
In Valerie's sample, the Shell.xaml file is where the XamDockManager is defined so this is where I handled the ToolWindowLoaded event. From here I could get the IRegionManager object that is attached to the shell and assign it to the floating window. The important thing here is grabbing the main IRegionManager where your region names are kept and assign it to the floating window. If the floating window doesn't have this manager, any region names defined inside the window won't be useable in your module.
I attached a modified version of Valerie's sample which loads a module view into the floating window.
I'm not sure where ToolWindowLoaded event needs to be handled, maybe you could illustrate using Valerie's sample?
My Shell calls a module, module calls mainViewModel, and mainViewModel calls various other viewmodels, one of which I want to be a floating panel.
Does the ToolWindowLoaded need to be handled in the Shell, mainViewModel, or childViewModel?
Also, I have IRegionManager on the childViewModel, not RegionManager, so SetRegionManager and GetRegionManager were not availible (briefly commented it out and replaced it with RegionManager instead of IRegionManager, not sure if it will have an averse affect on the code).
I think the issue is because the floating pane is in a seperate window and does not have a RegionManager. I tested this using Valerie's sample and was able to reproduce the error. To resolve this you will need to handle the ToolWindowLoaded event and then inside this event, assign the RegionManager for the window to the same one used by the shell.
private void XamDockManager_ToolWindowLoaded(object sender, Infragistics.Windows.DockManager.Events.PaneToolWindowEventArgs e) { // 'this' assumes that the XamDockManager is inside the shell xaml RegionManager.SetRegionManager(e.Window, RegionManager.GetRegionManager(this)); }
One thing you should be aware of is that when you create a floating SplitPane that contains an empty TabGroupPane, the floating window is not shown.
I think I understand what you are saying. So I changed my xaml to this:
<igWPF:XamDockManager x:Name="DockManager" >
<igWPF:XamDockManager.Content>
</igWPF:XamDockManager.Content>
<igWPF:XamDockManager.Panes>
<igWPF:SplitPane igWPF:XamDockManager.InitialLocation="DockedTop" SplitterOrientation="Vertical" Height="Auto" AllowDrop="False">
<im:InstrumentSummaryView />
<igWPF:TabGroupPane x:Name="bottomDock" prism:RegionManager.RegionName="{x:Static inf:KnownRegionNames.DockedBottom}" />
<igWPF:TabGroupPane x:Name="fee" prism:RegionManager.RegionName="{x:Static inf:KnownRegionNames.Fee}"/>
<igWPF:SplitPane igWPF:XamDockManager.InitialLocation="DockedRight" SplitterOrientation="Vertical" AllowDrop="True">
<igWPF:TabGroupPane x:Name="rightDock" prism:RegionManager.RegionName="{x:Static inf:KnownRegionNames.DockedRight}" />
<igWPF:SplitPane igWPF:XamDockManager.InitialLocation="DockableFloating">
<igWPF:TabGroupPane x:Name="securityBlotterPane" prism:RegionManager.RegionName="{x:Static inf:KnownRegionNames.SecurityBlotter}"/>
</igWPF:XamDockManager.Panes>
</igWPF:XamDockManager>
And my viewmodel is like this:
void OpenSecurityBlotter()
var view = _container.Resolve<SecurityBlotterView>();
view.DataContext = _container.Resolve<SecurityBlotterViewModel>();
var region = RegionManager.Regions[KnownRegionNames.SecurityBlotter]; //<-- Throws Error "The region manager does not contain the SecurityBlotter region."
Any idea why i'm getting that error on the open command "The region manager does not contain the SecurityBlotter region" ?
Mind you, if I execute any other open command in a similar fashion, for instance:
private void OpenFeeRebate()
var region = RegionManager.Regions[KnownRegionNames.Fee];
var view = _container.Resolve<FeeView>();
view.DataContext = _container.Resolve<FeeViewModel>();
region.Add(view);//add the view
region.Activate(view); //active the view
opening any other non floating panel works fine.
Is it because my floating panel has a TabGroupPane inside of the split pane instead of a ContentPane or...?