Let the NodeType of root be a sub-class of Window or Application

I made some minor changes so that the root node of the XAML file can be a sub-class of Window or Application. (The existing code failed when I used XAML with a root node of the MetroWindow class from the MahApps.Metro Nuget package)