Posts for #WPF

I stumbled upon this yesterday. If an external class needs to be referenced in a XAML file, a namespace must be mapped for it, so the compiler knows where to find that class. For example, I had a DataTemplate for a specific type in my file:

<DataTemplate DataType="{x:Type arbitraryName:Klasse}">
  <StackPanel Orientation="Horizontal">
    <TextBlock Text="{Binding Path=Name}" />
    <TextBlock Text=", Jahrgang " />
    <TextBlock Text="{Binding Path=Anfangsjahr}" />
  </StackPanel>
</DataTemplate>
1