Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] CoerceValue() does nothing #15024

Open
SuNNjek opened this issue Jan 5, 2022 · 0 comments
Open

[Bug] CoerceValue() does nothing #15024

SuNNjek opened this issue Jan 5, 2022 · 0 comments
Labels
a/Xaml </> s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@SuNNjek
Copy link
Contributor

SuNNjek commented Jan 5, 2022

Description

The CoerceValue() method introduced by #8097 doesn't seem to do anything anymore (don't know if it ever did).

I assume this has to do with the fact that the method just calls the handler without actually doing anything with the return value as you can see here:

property.CoerceValue?.Invoke(this, currentValue);

Whereas the SetValueCore() method does use it when you set a new value:
value = property.CoerceValue(this, value);

Steps to Reproduce

  1. Include issue page Issue5680.xaml in Xamarin.Forms.Controls.Issues.Shared project again
  2. Launch controls gallery and navigate to the page from 1.
  3. Enter 360 into "Rotation angle" textbox
  4. Enter a number lower than 360 into "Maximum angle" textbox

Expected Behavior

The rotation angle should be coerced to be the same value as the maximum angle.

Actual Behavior

Nothing happens and the rotation angle stays higher than the maximum angle.

Basic Information

  • Version with issue: 5.0.0
  • Last known good version: -
  • Platform Target Frameworks:
    • iOS: -
    • Android: -
    • UWP: -
  • Android Support Library / AndroidX Version:
  • NuGet Packages:
  • Affected Devices:

Environment

Show/Hide Visual Studio info
Microsoft Visual Studio Professional 2019
Version 16.11.7
VisualStudio.16.Release/16.11.7+31911.196
Microsoft .NET Framework
Version 4.8.04084

Installierte Version: Professional

Visual C++ 2019   00435-30013-71428-AA082
Microsoft Visual C++ 2019

ADL Tools Service Provider   1.0
This package contains services used by Data Lake tools

Allgemeine Azure-Tools   1.10
Bietet allgemeine Dienste für die Verwendung durch Azure Mobile Services und Microsoft Azure-Tools.

ASA Service Provider   1.0

ASP.NET and Web Tools 2019   16.11.94.52318
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.11.94.52318
Weitere Informationen finden Sie unter https://www.asp.net/.

Azure App Service-Tools v3.0.0   16.11.94.52318
Azure App Service-Tools v3.0.0

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.6.3000.0
Microsoft Azure Data Lake Tools for Visual Studio

Azure Functions and Web Jobs Tools   16.11.94.52318
Azure Functions and Web Jobs Tools

Azure Stream Analytics Tools for Visual Studio   2.6.3000.0
Microsoft Azure Stream Analytics Tools for Visual Studio

C#-Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
C#-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Erweiterungen der Visual Studio-Containertools   1.0
Hiermit werden Container in Visual Studio angezeigt, verwaltet und diagnostiziert.

Extensibility Message Bus   1.2.6 (master@34d6af2)
Provides common messaging-based MEF services for loosely coupled Visual Studio extension components communication and integration.

File Nesting   2.6.85
Automatically nest files based on file name and enables developers to nest and unnest any file manually

IntelliCode-Erweiterung   1.0
Detaillierte Informationen zur IntelliCode Visual Studio-Erweiterung

JetBrains ReSharper 2021.3.2   Build 213.0.20211221.144419
JetBrains ReSharper package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper. Copyright © 2022 JetBrains, Inc.

Microsoft Azure-Tools für Visual Studio   2.9
Support für Azure Cloud Services-Projekte

Microsoft Azure HDInsight Azure Node   2.6.3000.0
HDInsight Node under Azure Node

Microsoft Azure Hive Query Language Service   2.6.3000.0
Language service for Hive query

Microsoft Azure Stream Analytics Language Service   2.6.3000.0
Language service for Azure Stream Analytics

Microsoft Azure Stream Analytics Node   1.0
Azure Stream Analytics Node under Azure Node

Microsoft Continuous Delivery Tools für Visual Studio   0.4
Die Konfiguration von Azure DevOps-Pipelines von der Visual Studio-IDE aus wird vereinfacht.

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

Microsoft Visual C++-Assistenten   1.0
Microsoft Visual C++-Assistenten

Microsoft Visual Studio-Tools für Container   1.2
Jetzt können Sie Ihre ASP.NET Core-Anwendung in der Zielumgebung entwickeln, ausführen und überprüfen. Drücken Sie F5, um die Anwendung direkt in einem Container mit Debugfunktionen auszuführen, oder STRG+F5 zum Bearbeiten und Aktualisieren Ihrer Anwendung, ohne den Container erneut erstellen zu müssen.

Mono Debugging for Visual Studio   16.10.15 (552afdf)
Support for debugging Mono processes with Visual Studio.

Node.js-Tools   1.5.30526.3 Commit Hash:c09c81113bcbc86d57943fcdd67e82434263d61d
Fügt Unterstützung für das Entwickeln und Debuggen von Node.js-Apps in Visual Studio hinzu

NuGet-Paket-Manager   5.11.0
NuGet-Paket-Manager in Visual Studio. Weitere Informationen zu NuGet finden Sie unter https://docs.nuget.org/.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

Razor (ASP.NET Core)   16.1.0.2122504+13c05c96ea6bdbe550bd88b0bf6cdddf8cde1725
Provides languages services for ASP.NET Core Razor.

SQL Server Data Tools   16.0.62111.11070
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Testadapter für Boost.Test   1.0
Aktiviert Visual Studio-Testtools mit Komponententests, die für Boost.Test geschrieben wurden. Nutzungsbedingungen und Drittanbieterhinweise stehen im Installationsverzeichnis der Erweiterung zur Verfügung.

Testadapter für Google Test   1.0
Ermöglicht die Verwendung von Visual Studio-Testtools mit Komponententests, die für Google Test geschrieben wurden. Die Nutzungsbedingungen und Drittanbieterhinweise stehen im Installationsverzeichnis der Erweiterung zur Verfügung.

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

TypeScript-Tools   16.0.30526.2002
TypeScript-Tools für Microsoft Visual Studio

VC-Paket für Microsoft Visual Studio   1.0
VC-Paket für Microsoft Visual Studio

Visual Basic-Tools   3.11.0-4.21403.6+ae1fff344d46976624e68ae17164e0607ab68b10
Visual Basic-Komponenten, die in der IDE verwendet werden. Abhängig von Ihrem Projekttyp und den zugehörigen Einstellungen kann eine andere Version des Compilers verwendet werden.

Visual C++ für plattformübergreifende Mobile-Entwicklung (Android)   16.0.31829.152
Visual C++ für plattformübergreifende Mobile-Entwicklung (Android)

Visual F# Tools   16.11.0-beta.21514.6+b6c2c4f53ea3a08fa603ea93d6d2f808a62a21d1
Microsoft Visual F# Tools

Visual Studio-Tools für CMake   1.0
Visual Studio-Tools für CMake

Visual Studio-Tools für Container   1.0
Visual Studio-Tools für Container

Visual Studio Code-Debugadapter-Hostpaket   1.0
Interopebene zum Hosten der Visual Studio Code-Adapter in Visual Studio

VisualStudio.DeviceLog   1.0
Informationen zum Paket

VisualStudio.Foo   1.0
Information about my package

VisualStudio.Mac   1.0
Mac Extension for Visual Studio

Xamarin   16.11.000.197 (d16-11@6934992)
Visual Studio-Erweiterung, um Entwicklung für Xamarin.iOS und Xamarin.Android zu ermöglichen.

Xamarin Designer   16.11.0.47 (remotes/origin/d16-11@e0d612363)
Visual Studio-Erweiterung zum Aktivieren der 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   12.0.0.3 (d16-11/f0e3c2d)
Xamarin.Android Reference Assemblies and MSBuild support.
    Mono: c633fe9
    Java.Interop: xamarin/java.interop/d16-11@476bb5b
    ProGuard: Guardsquare/proguard/v7.0.1@912d149
    SQLite: xamarin/sqlite/3.35.4@85460d3
    Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-11@87af37b


Xamarin.iOS and Xamarin.Mac SDK   15.2.0.17 (738fde344)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

Build Logs

Screenshots

Reproduction Link

Workaround

The only workaround I found is manually set the value as such:

Value = CoerceMethod(Value);
@SuNNjek SuNNjek added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 5, 2022
@SuNNjek SuNNjek mentioned this issue Jan 7, 2022
2 tasks
@jsuarezruiz jsuarezruiz added this to New in Triage via automation Jan 10, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/Xaml </> s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
New
Development

Successfully merging a pull request may close this issue.

2 participants