I am new to WPF and I am trying to resolve an error. I am trying to build a custom control library where I can make my own control objects. When I go to File > New Project > WPF Custom Control Library > [Enter name] > Save, then instant error:
The name "CustomControl1" does not exist in the namespace "clr-namespace:ProjectName"
I did not edit any code but immediately an error. For reference, the error is inside Generic.xaml.
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ProjectName">
<Style TargetType="{x:Type local:CustomControl1}"> //<--Fails here
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:CustomControl1}"> // Fails here as well
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
I am using Visual Studio 12 and .NET 4. Any ideas?
fully qualified
name of yourCustomControl1
class? – Constitutionalism