I created WPF UserControl which enables to enter some information now I have Main entry form where I want to use tow instances of that UserControl When I add my YserControl as Resource and than try to use it as ContrntControl’s Content exception is thrown informing that control is already a logical child. Can anyone provide with sollution?
I created WPF UserControl which enables to enter some information now I have Main
Share
You can use the
x:Sharedattribute so that whenever something references the resource, a new instance is created instead of it being shared.Thus you might have something like this:
http://msdn.microsoft.com/en-us/library/aa970778.aspx
http://www.wpfmentor.com/2009/01/how-to-ensure-new-instance-of-resource.html