Static markup extension The Static markup extension can be used to refer to static members when assigning properties in XAML. The WPF x:Static extension supports public static properties and fields. One typical use is to refer to resources keys in typed resource files to localize. Especially since you are more likely to copy and paste a previous ObjectDataProvider you created and just change some parameters. Hence, its more error prone. The Better Way Lets look at how we can use features of WPF to improve the usage and readability of. UserControl z:faultMemberTypedemo:Resources TextBlock Textz:Static MemberTitle / Invoking static methods. In addition to support for accessing static properties and fields, like the WPF x:Static extension, the Silverlight. Static markup extension supports invoking static methods as simple as this: TextBlock Text"z:Static MemberTypedemo:MyModelView, Member'GetSum(7,6.3 / In this example. This._enumType value; public EnumBindingSourceExtension public EnumBindingSourceExtension(Type enumType) this. EnumType enumType; public override object ProvideValue(IServiceProvider serviceProvider) if (null this._enumType) throw new InvalidOperationException The EnumType must be specified. Type actualEnumType tUnderlyingType(this._enumType)? this._enumType; Array enumValues tValues(actualEnumType if (actualEnumType this._enumType) return enumValues; Array tempArray eateInstance(actualEnumType, enumValues. Defining a DataTemplate The first step is to actually define the DataTemplate. In most cases, you will define it as a resource somewhere within your application. For our example, lets just define it as follows in sources: sources DataTemplate x:Key"CharacterTemplate" Grid lumnDefinitions ColumnDefinition Width"100". Stack Exchange Inbox Reputation and Badges x Dismiss up vote 23 down vote favorite 11 I would think this is possible, but the obvious way isn't working. Currently, I'm doing this: ContentControl Content"Binding HurfView. But, of course, we want something a little better than just text. Ideally, wed like to have some formatted text along with an image of the character. This is where a template comes in handy What is a Template? Template" lue ControlTemplate Grid HorizontalAlignment"Stretch" VerticalAlignment"Stretch" TextBlock EMPTY! /TextBlock /Grid /ControlTemplate /lue /Setter /DataTrigger /iggers /Style /yle /ContentControl share improve this answer up vote 1 down vote You could return lue as the FallbackValue of the Binding the walking dead game get screwdriver for the Content of the ContentControl, and create. There are actually several ways to do this. The simplest approach is to explicitly set the template as the value of the ItemTemplate property of the ItemsControl, as shown here: ListBox Width"200" Height"300" ItemTemplate"StaticResource CharacterTemplate".