Tag Archives: data templates

Worked Example: Programmatic Addition of a WPF Data Template to a Resource Dictionary

I have noticed some interest in my earlier post on how to add a WPF data template to a resource dictionary in code and so this post is a demonstration of the technique.  The code is presented in F# but I have deliberately kept the code simple and fairly non-functional so that those of a C# or VB.NET background can follow the process easily.

Continue reading

Advertisements

Programmatic addition of a WPF DataTemplate to a ResourceDictionary

If you need (or want) to add a DataTemplate (or related class) object to a WPF resource dictionary programmatically then you need to understand how XAML data templates are added to the resource dictionary.

Continue reading