如何使BorderThickness从WPF资源键接收其值?

Nam*_* VU 4 wpf resources border thickness

我尝试创建String,Int32资源如下,但它不起作用.我收到错误,说该值无法转换.

如果你知道怎么做,请帮忙.

<ResourceDictionary 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:sys="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <sys:Int32 x:Key="MyKey">1</sys:Int32>
</ResourceDictionary>

<Label Content="abb" BorderThickness="{StaticResource MyKey}" />
Run Code Online (Sandbox Code Playgroud)

Hom*_*mam 7

该类型BorderThicknessSystem.Windows.ThinknessInt32

<Thickness x:Key="MyKey" >1</Thickness>
Run Code Online (Sandbox Code Playgroud)

祝好运!