Question : Setting Owner property of a child window in the owner's constructor causes a XamlParseException

Suppose I have two windows the owner called MainWindow and the child window called PasswordWindow. If I attempt to set the Owner property of the PasswordWindow to MainWindow in the MainWindow's constructor it compiles but throw a XamlParserException exception when run. See and download this code for example about what I mean

Answer : Setting Owner property of a child window in the owner's constructor causes a XamlParseException

Typically window creation is a two stage process (memory and then later the window object), setting the parent in the constructor is likely to give problems because the underlying window object has not yet been created.
Random Solutions  
 
programming4us programming4us