-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Xamarin forms effects doesnt get attached to Pages or layouts #3445
Comments
Hi, i have tried and i m able to attach effects to Pages and Effects, what's the platform and layouts you are trying that aren't working? Can you attach a smal reproduction sample with what's not working. Thanks |
I'm doing a little refine for the
And the effect doesn't apply |
The routing effect:
|
The platform effect:
|
This maybe needed a bit more info. Are you using |
@AdhamAliAhmed Since we haven't heard from you in more than 30 days, we hope that this issue is no longer affecting you. If it is, please feel free to reopen this issue and provide the requested information. Thank you for your report! |
Hi I have checked the effect with page in xamarin forms. Its not working. Please Reopen this issue. |
@rmarinho can you explain how to your page does working with effects? |
@adhamali450 It is working now for you.? This issue created over 5 years.. |
Description
A lot of XF Pages and Layouts doesn't accept effects. You add the effects to the Effects collection and all but they doesn't get attached. Meaning that if you either attach the effect from XAML or code it doesn't get attached.
In Xaml you attach it using:
In code you attach it either using:
Page.Effects.Add(new Effects.UwpAcrylicPage);
or using:
Page.Effects.Add(Effects.Resolve("ResolutionGroupName.EffectName"));
In the first attempt (Adding the effect to the Effects collection) it doesn't do anything. However, in the second attempt(Resolving the effect), it jumps to the constructor of the Effect in the platform specific project but then it jumps out. Even if you tried to call OnAttached() method in the constructor. The element initializes to null.
Steps to Reproduce
I tried to inspect this error but i found that the Effects collection is declared in Element class. Which every XF control inherits it whether a visual control or not. And the effect applies on every VisualElement except Pages and Layouts. So i hope the XF team or the contributors finds the bug if exists
Expected Behavior
The effect attaches and runs the OnAttached() method.
Actual Behavior
Doesn't get attached and doesn't call the OnAttached() method.
Basic Information
The text was updated successfully, but these errors were encountered: