Pound sign (#) and exclamation mark (!) chars on Default propery

Jul 14, 2009 at 7:52 AM

What is the meaning of these chars on Default property of ResExtension:

{res:Res Id=HelloWorld,Default=Hello World#}

{res:Res Static=local:LocalizationInfoRes.mnuHelp_Header,Default=Help!}

Is this something built-in to the WPF? Thanks!

Jul 15, 2009 at 6:34 PM

They are not required. It's an optional thing that I do when I create the default values so that I can visibly see when a default value is loaded. This was primarily when doing development of the extension so I could tell the difference in the designer when default values where used which effectively means there's a problem in the provider or the key.

In general I think this is a good idea for development as well though. If you end up rendering a default value it means that something is wrong with the binding/provider and it needs to be fixed. If the default value and the default local culture value are the same you never know there's a problem until you switch into another language... The marker character lets you see immediately that there's a problem that needs to be addressed while still providing a usable placeholder with a realistic value.

But - totally optional. You don't have to use any special characters or you can choose what characters you use.

Hope this helps,

+++ Rick ---

Jul 15, 2009 at 6:53 PM

Ah OK then, thanks!