It is then possible, if you retain this information, to update the property after the markup extension has already been evaluated.
To carry out this task, we can create an abstract class methods.
Now you spend 30 minutes trying to map your Text DP to your text Search.
Then one day, you decide you need this control needs to be bindable.
Binding Expression: Path=Content One Template Selector; Data Item='String' (Hash Code=-694847); target element is 'Content Presenter' (Name=''); target property is 'Content Template Selector' (type 'Data Template Selector') Notice that for some reason the Content One Template, Content One Template Selector, Content Two Template and Content Two Template Selector are bound to an object of type ‘String’. Because the moment you sent the Content Property of the Content Presenter its Data Context was switch to match the value of the Content property.
Since the Content of the both Content Presenters are string, “Hello” and “World” all other bindings on the Content Presenter are now resolved against these string values!
Here’s a simple example to illustrate how to use this class.
Let’s assume we want to create a custom markup extension which indicates whether the network is available.