Hello Everyone,
I have set certain values to a property (IconWidth) in the Resources of a content view. This property is being used in a Style also contained in the same place.
However, when this is used in the style, the Image view seems to ignore this.
For example -
This doesn't work
<OnPlatform x:TypeArguments="x:Int32" Android="32" iOS="32" Default="32" x:Key="IconWidthVertical"/>
<Style TargetType="Image" x:Key="statusIconStyles">
<Setter Property="WidthRequest" Value="{StaticResource Key=IconWidthVertical}" />
<Setter Property="Aspect" Value="AspectFit"/>
</Style>
However, this does -
<Style TargetType="Image" x:Key="statusIconStyles">
<Setter Property="WidthRequest" Value="32" />
<Setter Property="Aspect" Value="AspectFit"/>
</Style>
What am I doing wrong here? Why dosen't the StaticResource
binding work?