unoplatform / uno

Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
https://platform.uno
Apache License 2.0
8.77k stars 706 forks source link

Uno.CommunityToolkit.WinUI.UI.Controls.LayoutTransformControl throws System.InvalidOperationException: [LayoutTransformControl-56242/: Invalid measured size -Infinity,-Infinity. NaN or Infinity are invalid desired size #10521

Open VRage opened 1 year ago

VRage commented 1 year ago

Current behavior

Expected behavior

No exceptions

How to reproduce it (as minimally and precisely as possible)

Workaround

Set a 'Loaded' Event for the LayoutTransformControl and set the Child programmatically:

<controls:LayoutTransformControl Loaded="LayoutTransformControl_Loaded">

private void LayoutTransformControl_Loaded(object sender, RoutedEventArgs e)
{
        if (sender is LayoutTransformControl ltc)
                ltc.Child = txtblock;
}

Works on UWP/WinUI

Yes

Environment

Other

NuGet package version(s)

uno.communitytoolkit.winui.ui.controls - 7.1.100

Affected platforms

WebAssembly

IDE

Visual Studio 2022

IDE version

Version 17.3.6

Relevant plugins

No response

Anything else we need to know?

No response

mrlacey commented 1 year ago

Note. This also effects WPF.