Domanda

cerco di creare String, risorsa Int32 come qui di seguito, ma non funziona. Ho avuto l'errore dicendo che il valore non può essere convertito.

Se si sa come fare questo aiuto per favore.

<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}" />
È stato utile?

Soluzione

Il tipo di BorderThickness è System.Windows.Thinkness non Int32

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

In bocca al lupo!

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top