I have a user control that I've created, however when I go to add it to the XAML in the window, intellisense doesn't pick it up, and I cant figure out how to add it to the window.
I'm pulling my hair out here!
Any help is greatly appreciated!
I have a user control that I've created, however when I go to add it to the XAML in the window, intellisense doesn't pick it up, and I cant figure out how to add it to the window.
I'm pulling my hair out here!
Any help is greatly appreciated!
You need to add a reference inside the window tag. Something like:
xmlns:controls="clr-namespace:YourCustomNamespace.Controls;assembly=YourAssemblyName"
(When you add xmlns:controls=" intellisense should kick in to make this bit easier)
Then you can add the control with:
<controls:CustomControlClassName ..... />
You probably need to add the namespace:
<Window x:Class="UserControlTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:UserControlTest"
Title="User Control Test" Height="300" Width="300">
<local:UserControl1 />
</Window>
couple of tips: first, make sure there is an xmlns at the top that includes the namespace your control lives in.
xmlns:myControls="clr-namespace:YourCustomNamespace.Controls;assembly=YourAssemblyName"
second, sometimes intellisense is stupid.