Is it possible to add null as a static resource of a markup element? I want to be able to refer to a value using the {StaticResource myKey} syntax. At the moment, the value I need to specify is null, but in the future it may not be. I have a few references to the value in the rest of the markup, and I would like them to refer to the resource key, and not to {x:Null} .
I expected to do this:
<Window.Resources> <x:Null key="myKey" /> </Window.Resources>
... but it does not work. It compiles, but at runtime, an XamlParseException is thrown saying that the resource reference cannot be resolved.
source share