我想知道如何在 xaml 中将本地 int 变量的值设置为 Int.MaxValue (在我的例子中位于 ResourceDictionary 中)。
类似的东西:(但有用的东西:))
xmlns:s="clr-命名空间:系统;程序集=mscorlib
<s:Int32 x:Key"HelloWorld">{x:Static s:Int.MaxValue}</s:Int32>
Run Code Online (Sandbox Code Playgroud)
编辑:
@伊恩:
谢谢:) 但是我如何将静态资源用作 int 呢?假设我的 ResourceDictionary 中有
<ResourceDictionary>
<x:Static
x:Key="HelloWorld"
Member="s:Int32.MaxValue"
/>
...
<blablalba TooltipService.ShowDuration="{StaticResource HelloWorld}"/>` <-- this does not work by the way
</ResourceDictionary>
Run Code Online (Sandbox Code Playgroud) xaml ×1