How do you create a customcontrol? Make sure it inherits from UserControl.
I just created a new project called "TestProj" - I right-clicked in the Add => UserControl solution explorer and named it CustomControl.
I managed to insert it through the following code:
<Window x:Class="TestProj.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TestProj" Title="MainWindow" Height="350" Width="525"> <Grid> <StackPanel> <local:CustomControl/> </StackPanel> </Grid>
source share