Posted 16 years ago
by Michael Smit

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
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();
}
}
}