Well, that example won't do anything - rather, it will fail, because isn't a markup extension named Example
in the WPF namespace.
But if there were a markup extension named Example
, what it would do is instantiate an ExampleMarkupExtension
object, set its ResourceKey
property, and then call its ProvideValue
method, which would return an object that would be used as the key for the item being added to the resource dictionary.
Without more context, it's hard to know what the example you've provided is intended to show. I'd guess that the concepts being demonstrated are a) that the key to a resource dictionary can be any object, not just a string, and b) that you can use a markup extension to generate that key. A real example:
<DataTemplate x:Key="{x:Type TextBox}">
which adds a DataTemplate
with a key of typeof(TextBox)
to the resource dictionary.