unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.07k stars 735 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 2 years ago

VRage commented 2 years 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.