C# 通过XAML绑定将静态只读值作为CommandParameter传递?

C# 通过XAML绑定将静态只读值作为CommandParameter传递?,c#,wpf,C#,Wpf,我定义了以下类: public static class A { public static readonly double MyWidth = 200d; } 如果我想将“MyWidth”作为命令参数发送给按钮,我该如何设置xaml <Button Caption="Large" CommandParameter="What should I type here?"> 谢谢 CommandParameter="{x:Static ns:A.MyWidth}"

我定义了以下类:

public static class A
{
      public static readonly double MyWidth = 200d;
}
如果我想将“MyWidth”作为命令参数发送给按钮,我该如何设置xaml

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

谢谢

CommandParameter="{x:Static ns:A.MyWidth}"

其中,
ns
已映射到相应的CLR命名空间。

请指定实例如何绑定到UI