Hi,
I saw the sample how to open CustomControls via code into a MD DocumentContainer within this thread:
https://www.syncfusion.com/forums/166896/wpf-documentcontainer-mdi (sample WpfApp28_a013ba-958063303)
I tried to open Windows in this way, but ever get an error message.
Is there a way to open Windows via c# code (not embedded within the XAML code) ?
Thanks and regards
Uwe
Hi Uwe,
We have prepared sample to meet your requirement “Adding controls as a document to the DocumentContainer via code behind”, please check the sample and let us know whether it is helpful.
Code snippet :
|
ContentControl contentcontrol = new ContentControl(); contentcontrol.Content = "Content of ContentControl"; DocumentContainer.SetHeader(contentcontrol, "Document"); documentContainer.Items.Add(contentcontrol); |
If we have misunderstood your query, please share more details about your requirement.
Regards,
Durga
Thanks Durga,
it should that my request was not clear.
In the sample I found in https://www.syncfusion.com/forums/166896/wpf-documentcontainer-mdi (sample WpfApp28_a013ba-958063303) customcontrols where added (UserControl which looked the same as a window).
UserControl1 user = new UserControl1();
documentContainer.Items.Add(user);
My question is, is it also possible to add a window direcly.
I added the orginal sample, where I tried to add the sales window and end in an exception.
Regards
Uwe
Hi Sudharsan,
thanks for the information. So I will create my Windows as UserControls and then it should work.
I will try it.
Regards
Uwe
Hi Sudharsan,
it is okay for me. It is not what I expected. MDI should be better in Winforms (what I did before).
Thanks for your help.
Regards
Uwe