UX expressions with size.

I’m trying to do X="{Property this.Width} - {Property handle.Width}", but it returns empty.

Also is there a way to convert between the different units in UX expressions.

Hi,

Those properties do not emit changed events. If you want to get the result of layout, you can use the width() and height() UX functions instead:

X="width(this) - width(handle)"

Thank you.

I tried this

<Move Target="handle" X="width(this) - width(handle)" />

But then I get this

Error E8001: 'Fuse.Elements.UX.WidthFunction' doesn't fit here. 'Fuse.Animations.Move' does not have any content properties that accepts 'Fuse.Elements.UX.WidthFunction'

Interesting, can you please share a bit more of the code around this?

(The restriction that you can’t use these functions on animators might be a bug in the current release that will go away in a future release, as I’m pretty sure this case is covered by tests internally now)

Here is a testcase:

<App>
	<Panel ux:Class="TestPanel" Background="#0f0">
		<Text Value="Teksten" X="width(this) - width(teksten) - 100" ux:Name="teksten" />
		<Clicked>
			<Move Target="this" X="width(teksten)" />
		</Clicked>
	</Panel>
	<StackPanel>
		<TestPanel />
	</StackPanel>
</App>

Does not compile in 0.35