xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.63k stars 1.87k forks source link

[Bug] Label text not updating completely if Binding changes at runtime when using MultiBinding #14616

Open temobgallardo opened 3 years ago

temobgallardo commented 3 years ago

Description

When changing Label.Text binding at runtime and using a Multibinding with a StringFormat it will not update the property fully.

Steps to Reproduce

  1. Run the
    LabelTextBinding_Issue.zip

https://user-images.githubusercontent.com/62340961/133329880-2a4b23e0-7ca6-40a1-a422-ec225c9386bf.mp4

Expected Behavior

The Label.Text to show the text fully.

Actual Behavior

It is showing the text truncated.

Basic Information

Environment

Show/Hide Visual Studio info ``` Microsoft Visual Studio Enterprise 2019 (3) Version 16.10.2 VisualStudio.16.Release/16.10.2+31410.357 Microsoft .NET Framework Version 4.8.04084 Installed Version: Enterprise ASP.NET and Web Tools 2019 16.10.526.50910 ASP.NET and Web Tools 2019 Azure App Service Tools v3.0.0 16.10.526.50910 Azure App Service Tools v3.0.0 C# Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Common Azure Tools 1.10 Provides common services for use by Azure Mobile Services and Microsoft Azure Tools. Extensibility Message Bus 1.2.6 (master@34d6af2) Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration. IntelliCode Extension 1.0 IntelliCode Visual Studio Extension Detailed Info Microsoft JVM Debugger 1.0 Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines Microsoft MI-Based Debugger 1.0 Provides support for connecting Visual Studio to MI compatible debuggers Mono Debugging for Visual Studio 16.10.15 (552afdf) Support for debugging Mono processes with Visual Studio. NuGet Package Manager 5.10.0 NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/ ProjectServicesPackage Extension 1.0 ProjectServicesPackage Visual Studio Extension Detailed Info TypeScript Tools 16.0.30429.2002 TypeScript Tools for Microsoft Visual Studio Visual Basic Tools 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used. Visual F# Tools 16.10.0-beta.21262.7+1b23bbeda88ea3cb9be9af777f4c99fa8663df81 Microsoft Visual F# Tools Visual Studio Code Debug Adapter Host Package 1.0 Interop layer for hosting Visual Studio Code debug adapters in Visual Studio VisualStudio.DeviceLog 1.0 Information about my package VisualStudio.Foo 1.0 Information about my package VisualStudio.Mac 1.0 Mac Extension for Visual Studio Xamarin 16.10.000.231 (d16-10@8111164) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android. Xamarin Designer 16.10.0.115 (remotes/origin/c750fbf1bde3c720d077f51640fe197c6dac7cbe@c750fbf1b) Visual Studio extension to enable Xamarin Designer tools in Visual Studio. Xamarin Templates 16.10.5 (355b57a) Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms. Xamarin.Android SDK 11.3.0.4 (d16-10/ae14caf) Xamarin.Android Reference Assemblies and MSBuild support. Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0 Xamarin.iOS and Xamarin.Mac SDK 14.20.0.10 (0e35b2e0b) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support. ```

Build Logs

Screenshots

Reproduction Link

Workaround

maonaoda commented 3 years ago

This seems to have nothing to do with MultiBinding. When the Binding Text is changed in response to PropertyChanged, whether it is Label or Button, this problem will appear.

This problem exists on Xamarin.Forms 5.0.0.2125 and Xamarin.Forms 5.0.0.2083. But there is no problem on Xamarin.Forms 4.8.0.1821. (Other versions had not been confirmed) .

c-judge commented 2 years ago

I see the same issue in my project with Xamarin.Forms 5.0.0.2515.

If binding property of a Label is changed, and it is longer than what was there previously, the text gets cut off.