Extending DocumentWindow

Docking/MDI for WPF Forum

Posted 11 years ago by Michael Smit
Avatar
Okay, maybe I am bit a bit doff here, but I am struggling to create controls that inherit from DocumentWindow.

I do the following...

1. Create a new UserControl.
2. Change the XAML to inherit from DocumentWindow.
3. Change the code behind to inherit from DocumentWindow.
4. Rebuild.

If I then try to drag a normal Button control onto the design surface, I get "The specified visual is not a descendant of this visual". I can however drag the control directly into the xaml, but it does not show up on the design surface.

Please would someone provide the correct methods to follow to create controls of type DocumentWindow that have full designer support. I suspect I am doing it wrong as it appears others here have gotten this right.

TIA

<docking:DocumentWindow x:Class="ActiproTest.Test"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
    Height="300" Width="300">
    <Grid>         
    </Grid>
</docking:DocumentWindow>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace ActiproTest
{
  /// <summary>
  /// Interaction logic for Test.xaml
  /// </summary>
  public partial class Test : ActiproSoftware.Windows.Controls.Docking.DocumentWindow
  {
    public Test()
    {
      InitializeComponent();
    }
  }
}

Comments (6)

Posted 11 years ago by Michael Smit
Avatar
Any ideas people?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Michael,

Good news, we found the problem and this is now fixed for the next maintenance release. It will support designer interaction.


Actipro Software Support

Posted 11 years ago by David Mullin
Avatar
I'm experiencing a similair issue in that, at run time, my custom document window class doesn't end up with a tab

<docking:TabbedMdiHost x:Name="tabbedMdiHost" Background="Transparent">
    <docking:TabbedMdiContainer>
        <ctDesktopControls:QueryDocumentWindow Title="Main 1" x:Name="Main1" />
        <docking:DocumentWindow Title="Main 2" x:Name="Main2" />
    </docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
When I run this, "Main 1" does not have a tab, but "Main 2" does. Is this also addressed in the latest maintenance release, or it is a new issue?

Thanks!
Posted 11 years ago by David Mullin
Avatar
I am also getting similair behavior with ToolWindows:

<docking:ToolWindowContainer >
    <ctDesktopControls:FavoriteQueriesToolWindow />
    <ctDesktopControls:QuerySetToolWindow />
    <ctDesktopControls:QuerySetToolWindow />
</docking:ToolWindowContainer>
Related?
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi David,

We just put out build 480 on Friday. Not sure if that would with your scenario or not. If not, maybe make a simple sample project that shows it happening and email it over.

Alternatively we have a QuickStart that shows inherited tool and document windows so maybe tweak that to show it and let us know how.


Actipro Software Support

Posted 11 years ago by David Mullin
Avatar
As it turns out, I was already doing it the way you demonstrate in your QuickStart. However, upgrading to the 480 build resolved the issue.

Thanks!
The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.