Passing a readonly static value as a CommandParameter parameter through XAML binding?

I have the following class:

public static class A
{
      public static readonly double MyWidth = 200d;
}

If I want to send "MyWidth" as a command parameter to a button, how do I configure xaml for this?

<Button Caption="Large" CommandParameter="What should I type here?">

Thank!

+3
source share
1 answer
CommandParameter="{x:Static ns:A.MyWidth}"

where nsmapped to the corresponding CLR namespace.

+5
source

All Articles