Is there any way possible to get access to a custom MarkupExtension from code-behind? eg.
<TextBox Name="text" Text="{my:CustomExtension}" />
I want to be able to get access to the ‘CustomExtension’ instance.
I’ve created my own lightweight binding, but this is the only real gap in the solution. If I set the above from code, then I can keep the CustomExtension instance in an attached property, but in the above case the XAML parser wont do it.
Markup extensions are “resolved” when the property is needed, in that moment they will be replaced by the value they provide via
ProvideValue. You probably won’t be able to get an instance unless you add something to yourMarkupExtensionwhich passes it along.