There is a race condition issue when subscribing to ProviderManager.Instance.ProviderStateChanged. Currently this only works if you do this before ProviderManager.Instance.GlobalProvider is setup.
Steps to Reproduce
It is easy to see this in the UwpMsalProviderSample project. Change the constructor of LoginButton to this:
Describe the bug
There is a race condition issue when subscribing to
ProviderManager.Instance.ProviderStateChanged
. Currently this only works if you do this beforeProviderManager.Instance.GlobalProvider
is setup.Steps to Reproduce
It is easy to see this in the UwpMsalProviderSample project. Change the constructor of
LoginButton
to this:Now when the application is executed the text on the sign in button will not be updated.
Expected behavior
It should not matter when you subscribe to
ProviderManager.Instance.ProviderStateChanged
.Additional context
I will create an PR for this.