Bug 58406 - Effect is never attached to Label, but is attached to Label subclass (Android)
Summary: Effect is never attached to Label, but is attached to Label subclass (Android)
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.5
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
Depends on:
Reported: 2017-07-26 03:17 UTC by Chase Long
Modified: 2017-08-14 18:09 UTC (History)
5 users (show)

Tags: ac fr
Is this bug a regression?: ---
Last known good build:

Sample solution that reproduces the bug (62.42 KB, application/x-zip-compressed)
2017-07-26 03:17 UTC, Chase Long

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Chase Long 2017-07-26 03:17:22 UTC
Created attachment 23803 [details]
Sample solution that reproduces the bug

I created an app with one ContentPage containing a Label. A custom Effect is added to the Label's Effects collection. The Effect is never attached. I then created a Label subclass named MyLabel and replaced the Label with a MyLabel, and attached the same Effect. The Effect correctly attaches to the MyLabel instance.

The Effect should attach to both MyLabel and Label instances.

I checked this on Android. I did not check it on iOS or UWP.

This looks very similar to #58072 (https://bugzilla.xamarin.com/show_bug.cgi?id=58072), so I followed the advice given in that bug's comments. I deleted all /bin and /obj directories, uninstalled the app from my device, restarted Visual Studio, rebuilt the solution, and ran the app again. These steps did not resolve the issue.

# Repro steps
See the attached sample solution. The Effect renderer and MyLabel definitions are in ListItemTap.Android/Renderers.cs. The Effect usage is in MyPage.cs.

1. Run the app with MyPage.cs line 11 commented out.
2. Notice that the Effect is attached, as indicated by the Debug output line "TAG OnAttached".
3. Comment out MyPage.cs line 10 and uncomment line 11.
4. Run the app and notice that the Effect is not attached, as suggested by the "TAG OnAttached" line not being printed to the Debug output.

# Version information
Visual Studio 2017
Xamarin.Android SDK (9dbc4c5)
Tested on a Samsung Galaxy S7 running Android 7.0
Comment 1 Paul DiPietro [MSFT] 2017-07-26 19:36:04 UTC
This is an issue with the new fast renderer not attaching the effect. We'll fix this.
Comment 2 E.Z. Hart [MSFT] 2017-08-01 17:18:13 UTC
PR: https://github.com/xamarin/Xamarin.Forms/pull/1077