Hi,
I think that I understand what you mean: How to create a UserControl with a place for his content:
[ContentProperty("PlaceHolder")]
public partial class UserControl1 : UserControl
{
public UserControl1()
{
InitializeComponent();
}
public object PlaceHolder
{
get
{
return this.contentPresenter.Content;
}
set
{
this.contentPresenter.Content = value;
}
}
}
<UserControl x:Class="WpfApplication9.UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<DockPanel LastChildFill="True">
<Border removed="Plum" DockPanel.Dock="Top" Height="50" />
<Border removed="Blue" DockPanel.Dock="Bottom" Height="50" />
<ContentPresenter x:Name="contentPresenter" />
</DockPanel>
</UserControl>