StaticExtension not found

I have encountered funny bug/feature when I was writting first xaml file in my new project. I used the StaticExtension the way I was used to… and for some obscure reason it did not work. This is what I typed:

<Someclass SomeProperty="{x:Static SomeOtherClass:SomeStaticProperty}"/>

But Visual Studio did not like it and complained that Static is not recognized. I doubled checked project references, compared them with those of last project and did not find anything what could have caused it. After some googling I read that the Static is actually named StaticExtension. The word ‘static’ is just some kind of shortcut. When I typed the fullname and hit Alt+Enter to automatically add ‘using statement’, the Visual Studio downloaded something (I did not have time to read what or to capture it via print screen) and everything started to work 🙂 Magic 🙂

So the conclusion is: When you ever run in trouble when using x:Static try to supply the full name StaticExtension.

Hope this helps someone.


[quesswork] And the reason I could not find any difference in References is IMHO that the namespace System.Windows.Markup is inside WindowsBase Reference. And because WindowsBase was already there I did not see that System.Windows.Markup was missing. … It is part of WindowsBase