Global values not fully working with Margins

Fuse version: 1.2.1 (build 13974)

OS: Windows 10

Using the Margin=“A,B” format which should result into a margin of “A,B,A,B” does not work when using [global] variables

Here is a screenshot with the issue and the code behind it

<App>
	<float4 ux:Global="SP" ux:Value="15" />
	<StackPanel Background="#999" >
		<Image File="Assets/car.jpg" StretchMode="Uniform" Margin="SP * 2, SP * 3, SP * 2, SP * 2.5"/>
		<Image File="Assets/car.jpg" StretchMode="Uniform" Margin="SP * 2, SP * 3"/>
		<Image File="Assets/car.jpg" StretchMode="Uniform" Margin="30, 45"/>
	</StackPanel>
</App>

The issue also applies for the Padding

Thanks for reporting! I’ve now logged a ticket and you can watch it for further updates.

A float4 is supposed to hold 4 components, so you should be using float as the type for the global in this case. That, however, still has the same problem and I’ve updated the ticket to reflect that.

As a workaround, you can define your globals like this, and use them accordingly:

<App>
    <float ux:Global="SP1" ux:Value="15" />
    <float4 ux:Global="SP4" ux:Value="30,45" />
    <StackPanel Background="#999" >
        <Image Url="https://unsplash.it/200/50" StretchMode="Uniform" Margin="SP1 * 2, SP1 * 3, SP1 * 2, SP1 * 2.5"/>
        <Image Url="https://unsplash.it/200/50" StretchMode="Uniform" Margin="SP4"/>
        <Image Url="https://unsplash.it/200/50" StretchMode="Uniform" Margin="30, 45"/>
    </StackPanel>
</App>

@Uldis I already bypassed it using “SP * 2, SP * 3, SP * 2, SP * 3”, but your solution is good as well. Since you made a ticket for it you can close the thread and mark it as resolved.

That we will do once the related ticket is resolved :slight_smile: