Hi,
I need help regarding your control DockingManager, i am delevelping an mvvm based wpf application.
I have on the MainWindow menu bar which contains 3 items:
And below the menu bar i have DockingManager.
And i have 3 user controls
Now i want to click on Customers menu item and show CustomersView(usercontrol) in DockingManager as tab and same with Employees menu item adds new tab in DockingManager and shows EmployeesView(usercontrol) and same with the Reports.
If the CustomerView(usercontrol) is already opened as tab in DockingManager and the user clicks again on the Customers(menuitem) it shouldn't open another CustomersView(usercontrol) but select the already opened CustomerView(usercontrol) tab and bring it in focus.
Any sample project that does the same thing will be a great help.
Thank you
Anyone please?
Hi fahad,
We suggest you to active the existing child item using ActivateWindow method of DockingManager, child item’s name should be the argument of the method. Please find the sample for the same.
If we have misunderstood your query please provide more details about your requirement or sample to check this further.
Regards,
Durga
Thanksfor the reply,
It works like i wanted, but i dont just want to Add empty DockPanel, i need to show a usercontrol instead.
Howdo i change the following code, so that when i click Customers(menuitem)CustomersView(usercontrol) shows instead of empty DockItem.
if(!childExist)
{
DockItem dockItem =newDockItem();
dockItem.Name= obj.ToString();
dockItem.Header= obj.ToString();
dockItem.State=DockState.Document;
DockCollections.Add(dockItem);