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
8.95k stars 726 forks source link

[Android] `ViewBox` with nested `TextBlock` with `Text` binding does not properly update layout #7490

Open mikernet opened 2 years ago

mikernet commented 2 years ago

Current behavior

If you have something like:

<Viewbox>
    <TextBlock Text="{x:Bind Model.Name}" FontSize="48" FontWeight="Bold" Foreground="White" HorizontalAlignment="Center"/>
</Viewbox>

If Model is null when the page is first navigated to but subsequently asynchronously updated and Bindings.Update() is called then the layout/sizing of the view box content is not updated correctly and no text is visible.

Expected behavior

No response

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

Test project: https://github.com/mikernet/UnoTest2

See the ViewBox here: https://github.com/mikernet/UnoTest2/blob/8f15695a6659a493b664cfb1ceaed0fb7d1ff864/Source/UnoTest.Shared/Pages/BusinessPage.xaml#L24

Launch the project in iOS/WASM/UWP, click Login and then go to BusinessPage. Notice that after the page loads it says Singulink in the title bar area. On Android the text inside the ViewBox never shows up:

image

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

3.11.0-dev.210, 3.11.6, 4.x-dev.latest

Affected platforms

Android

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

jeromelaban commented 2 years ago

Like related to https://github.com/unoplatform/uno/pull/6287