UIElement.InvalidateArrange() and UpdateLayout() Alternatives in Uno Platforms

271 Views Asked by At

It seems the Uno Platform doesn't support InvalidateArrange() and UpdateLayout() methods within UIElement. When building an existing UWP project warnings such as below may appear:

...\Source\UserControls\View\TableView.xaml.cs(743,17,743,39): warning Uno0001: Windows.UI.Xaml.UIElement.InvalidateArrange() is not implemented in Uno
...\Source\UserControls\View\TableView.xaml.cs(745,17,745,34): warning Uno0001: Windows.UI.Xaml.UIElement.UpdateLayout() is not implemented in Uno

What is the suggested alternative? How should a UIElement be invalidated and then updated in Uno? I note that InvalidateMeasure() does appear to be implemented.

In UWP it was necessary to manually invalidate both measure and arrange and then force an update or glitches would occur. Whether or not this is a UWP internal issue is probably not important here.

1

There are 1 best solutions below

1
On

While those methods are not yet implemented on all platforms, invoking them anyways is safe.

You may need still to invoke UIElement.InvalidateMeasure() for this to work properly on Uno.