How to get Height of an element?

I would like to know the Height of an element and create animation based on that value. How can I do this?

It would nice if something like this would work:

<WhileActive>
    <Change Spacer.Height="MyElement.Height" Duration="0.6" />
</WhileActive>

Or if I could know a height of an element in Fuse JS it would be nice too.

I also tried to get the Height of MyElement from Uno (looping in update), but it turns out Height is always 0 in this case:

<StackPanel ux:Name="MyElement">
  <Each Items="{messages}">
    <MessageView TextValue="{msg}" />
  </Each>
</StackPanel>

Got my crap working by hacking with RelativeTo and RelativeNode

Hi Simo,

Any chance of being able to explain how you hacked the RelativeTo and RelativeNode to work.

@Sergio: hacking those is not necessary any more since we introduced UX expressions a while ago. Hint: height(uxName).

There are still many use cases where RelativeTo and RelativeNode make much more sense than UX expressions, so I welcome you to make a new forum post explaining what you’re trying to achieve.

Once again, Thank You Uldis.