5

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}" />
4

1 に答える 1

9

の型BorderThicknessSystem.Windows.ThinknessではありませんInt32

<Thickness x:Key="MyKey" >1</Thickness>

幸運を!

于 2010-11-04T12:30:32.620 に答える