Monday, 23 May 2011

Binding to a constant in XAML WPF

Example...

Add this to your controls namespace declarations

xmlns:MyNameSpace="clr-namespace:MyNameSpace;assembly=MyAssembly"

then use it as follows in your markup

ToolTipService.ShowDuration="{x:Static MyNameSpace:MyClass.MY_CONSTANT}"

No comments:

Post a Comment

Android mediaserver process killing battery life

If this happens to you, then do the following Force stop on Settings, Applications, All, Media Storage. Clear Cache and Clear Data, fo...