How to get BorderThickness to get its value from a WPF resource key?

I am trying to create a String resource, Int32 , as shown below, but it does not work. I got an error stating that the value could not be converted.

If you know how to do this, please help.

 <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
source share
1 answer

Type BorderThickness System.Windows.Thinkness is not Int32

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

Good luck

+7
source

All Articles