Posted 12 June 2023, 6:33 pm EST
Hi Rambabu,
C1Window’s ShowModal method displays a window over a greyed-out layer preventing the user from interacting with anything else until the window is closed.
it blocks all the docking controls float/hide.
As per our understanding you don’t want that the other functionality of C1DockControl to get blocked when new window is opened. If this is the case, we recommend you display the window using Show() method.
I need the window to open inside the C1DockTabcontrol, is there any way to implement this?
In order to achieve the required behavior, you can modify the code inside button’s click event as shown in the following code:
[code]var tabItem = btn.Parent as C1DockTabItem;
var tabControl = tabItem.Parent as C1DockTabControl;
// Get the position of the control relative to the window
Point positionRelativeToWindow = tabControl.TransformToAncestor(Application.Current.MainWindow)
.Transform(new Point(0, 0));
// The positionRelativeToWindow variable now contains the control's position relative to the window
double x = positionRelativeToWindow.X;
double y = positionRelativeToWindow.Y;
C1Window window = new C1Window();
window.Width = 300;
window.Height = 300;
window.Left = (tabControl.ActualWidth > window.Width) ? (x + (tabControl.ActualWidth - window.Width)/2 ): x;
window.Top = (tabControl.ActualHeight > window.Height) ? (y + (tabControl.ActualHeight - window.Height) / 2) : y;
window.Content = "Hello World!";
window.Show();[/code]
Kindly refer to the attached sample for full implementation. See DockingExplorer_Mod.zip
Please let us know if you need any further help.
Thanks & Regards,
Aastha