Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
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
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 for Bug 38739 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
Created attachment 15034 [details]
I tried to apply an Effect to a Cell, but that doesn't seem to work. My OnAttached method in the Effect is never called.
I tried this with XF 2.1.0-pre4 on iOS, Android, UWP and WinRT desktop.
I'm pretty sure, that I configured the Effect correctly. In the 2nd sample project for bug #33450 I tried to apply the same Effect to a ListView and a Cell. The OnAttached method was called for the ListView, but not for the Cell.
Ran into the same thing today. Posted a simple repro of the issue on the forums here: https://forums.xamarin.com/discussion/65809/custom-effects-api-and-listview-cells
I ran into the same issue today as well.
I can attach the effect using code behind or XAML but the OnAttached method is never called.
=== Xamarin Studio Enterprise ===
Version 6.1.1 (build 15)
Installation UUID: e4bb5169-0b81-4f08-894d-b923b012af71
Mono 4.6.1 (mono-4.6.0-branch-c8sr0/abb06f1) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 406010003
=== NuGet ===
=== Xamarin.Profiler ===
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Apple Developer Tools ===
Xcode 8.0 (11246)
=== Xamarin.Android ===
Version: 220.127.116.11 (Xamarin Enterprise)
Android SDK: /Users/tiffany_ip/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.4 (API level 19)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
SDK Tools Version: 25.2.2
SDK Platform Tools Version: 24.0.3
SDK Build Tools Version: 24.0.2
Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
Android Designer EPL code available here:
=== Xamarin Android Player ===
Location: /Applications/Xamarin Android Player.app
=== Xamarin.Mac ===
Version: 18.104.22.168 (Xamarin Enterprise)
=== Xamarin.iOS ===
Version: 10.0.1.8 (Xamarin Enterprise)
Build date: 2016-09-23 15:34:54-0400
=== Xamarin Inspector ===
Build date: Mon Jun 13 19:14:13 UTC 2016
=== Build Information ===
Release ID: 601010015
Git revision: fa52f02641726146e2589ed86ec4097fbe101888
Build date: 2016-09-22 08:03:02-04
Xamarin addins: 75d65712af93d54dc39ae4c42b21dfa574859fd6
Build lane: monodevelop-lion-cycle8-sr0
=== Operating System ===
Mac OS X 10.11.6
Darwin mt-mac-tiffanyip.local 15.6.0 Darwin Kernel Version 15.6.0
Mon Aug 29 20:21:34 PDT 2016
=== Enabled user installed addins ===
Xamarin Inspector 0.9.0.14
Effects are designed to give you access to the native view as well as the PCL view. They are similar to custom renderers. The problem is cells are not visual elements hence do not implement IVisualElementRenderer. That means cells do not have a mechanism to show you the native cell renderer as well as the native cell.
When you add an effect, it gets translated to a PlatformEffect in native. It expects properties that relate to the native fields so you can use them in the effect implementations. When you attach an effect to a non-visual element, while the constructor will be executed, OnAttached() and OnDetached() won't because there is no effect control provider for Element.
To cut it short, right now, it is not possible to attach effects to views that are not VisualElements.
This could; however, be considered as an enhancement. I'm not sure how much re-architecting would be required for this.
Thanks for the analysis, Adrian. I was already suspecting that the root of the problem is once again, that Cells are only Elements, but no VisualElements or Views.
However, as the Effects collection is a property in Element you can add Effects to Cells. If the API allows to add them but they don't work, then it is a bug and no enhancement. Xamarin also advertised Effects to be used on all controls and never mentioned Cells to be excluded from that.
In https://forums.xamarin.com/discussion/comment/183254/#Comment_183254 Jason Smith wrote on March, 2nd 2016:
> ... we will be adding support for that in a very near term point release that can start the -pre cycle again.
This might be a good piece of subject matter for the evolution forum (https://forums.xamarin.com/categories/xamarin-forms-evolution).