I’m trying my first WPF custom control. I’ve hardly done anything and it won’t compile. I get an error in my generic.xaml that says, “The type reference cannot find a public type named ‘Filmstrip’. Line 7 Position 50 (Line 7 is the Style start tag)
Generic.xaml:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespaces:Unicorn.Controls">
<Style TargetType="{x:Type local:Filmstrip}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Filmstrip}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
Filmstrip.cs
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 Unicorn.Controls
{
public class Filmstrip : Control
{
static Filmstrip()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(Filmstrip), new FrameworkPropertyMetadata(typeof(Filmstrip)));
}
}
}
What am I missing?
clr-namespaces:Unicorn.Controlsshould beclr-namespace:Unicorn.Controls. Singular, not plural.