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!!
Integrating LayoutTransformControl in your Wasm project, will throw 'System.InvalidOperationException: [LayoutTransformControl-56242/: Invalid measured size -Infinity,-Infinity. NaN or Infinity are invalid desired size' on startup
Expected behavior
No exceptions
How to reproduce it (as minimally and precisely as possible)
Create a normal Uno WASM project
Add 'Uno.CommunityToolkit.WinUI.UI.Controls' to your WASM project
Add 'LayoutTransformControl' to your MainPage.xaml
In the TransformLayoutContro.MeasureOverride(size) method the control tries to get the Child property, which is null in this moment. On the Loading-Event there is still a valid Child tho.
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;
}
Current behavior
Expected behavior
No exceptions
How to reproduce it (as minimally and precisely as possible)
Add 'LayoutTransformControl' to your MainPage.xaml
In the TransformLayoutContro.MeasureOverride(size) method the control tries to get the Child property, which is null in this moment. On the Loading-Event there is still a valid Child tho.
Workaround
Set a 'Loaded' Event for the LayoutTransformControl and set the Child programmatically:
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