Extending DocumentWindow

Docking/MDI for WPF Forum

Posted 16 years ago by Robert A. McCarter
Version: 4.5.0470
When I create a new DocumentWindow according to your documentation it works fine:

  TextBox content = new TextBox();
  string name = "MyDocumentWindow1";
  string title = "My First Document Window";
  BitmapImage image = new BitmapImage(new Uri("/Images/Test.png", UriKind.Relative);
  DocumentWindow window = new DocumentWindow(dockSite, name, title, image, content);
However, when I extend the DocumentWindow class with my own class (that had a few additional properties) the tab doesn't appear!

I have removed everything from my DocumentWindow class and it still doesn't work:

  public class TestDocumentWindow :
     public TestDocumentWindow(DockSite dockSite,
                     string docName, string title,
                     ImageSource imageSource, object content)
    : base(dockSite, docName, title, imageSource, content)
     { // EMPTY
I then modify the original creation code to use TestDocumentWindow rather than just DocumentWindow, and the window appears without a tab.

Are you guys actually checking to ensure it's an instance of a DocumentWindow and not allowing child classes?

Thanks for your assistance.



Comments (2)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Robert,

Actually this is an issue in general with how WPF doesn't properly apply styles/templates to inherited classes of styled controls.

We have been working on a resolution for it and finally think we came up with something. Our code update will be in the next maintenance release (4.5.471) and will include a QuickStart showing how to create both custom DocumentWindow and ToolWindow classes in XAML/codebehind and use them in a DockSite.

Actipro Software Support

Posted 16 years ago by Robert A. McCarter
Thank you for taking the time to look into this. :-)
The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.