I have this XAML:
<UserControl x:Class='M_Cubed.Controls.TagEditor' xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' xmlns:classes='clr-namespace:M_Cubed.Classes'> <UserControl.Resources> <DataTemplate DataType='{x:Type classes:TagEditorPic}'> <ComboBox DataContext='{StaticResource PicTypes}' ItemsSource='{Binding}'/> </DataTemplate> </UserControl.Resources> </UserControl>
I have this C#:
namespace M_Cubed.Classes { public class TagEditorPic : INotifyPropertyChanged { public TagEditorPic() { } } }
And I get this error:
Type reference cannot find public type named ‘TagEditorPic’.
Any suggestions?
I decided I’ll just set the x:Key attribute on the datatemplate and just bind the template properties onwards to the StaticResource of the x:Key. It works fine with me.