dotnet / dotnet/maui

Element Effect does't aply first time (some initialization issue)

Open
#6,729 5 comments 0 reactions 1 assignee Claimed by @jsuarezruiz View on GitHub
area-drawing p/2 platform/android s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 15h
Merged PRs (30d)
290

Description

### Description

I try to create my own custom effect (tint effect). It works as expected but it doesn't work for first time effect appling. It seems like some initialization issue there.
I create a sample app where you can see this issue (effect only implemented for android, ignore ios version).
![123](https://user-images.githubusercontent.com/1169410/166201326-901f6624-85c4-4a4f-a09f-7bacb0a799a5.svg)

### Steps to Reproduce

1. Grab code from https://github.com/nevse/Maui-Tests-EffectVsInitialization
2. run android version `dotnet build -t:Run -f:net6.0-android`
3. see on image - it should be red (bug with tint effect in action).
4. reload page via button click (it runs code `Application.Current.MainPage = new MainPage();`)
5. you see that image is red (tint effect in action)

### Version with bug

Release Candidate 2 (current)

### Last version that worked well

Unknown/Other

### Affected platforms

Android

### Affected platform versions

android 31 and others

### Did you find any workaround?

_No response_

### Relevant log output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.