17

I'm porting a Xamarin.Android project to .Net 6.

Because of dependencies, it's not possible to include Xamarin.Essentials in the .Net 6 project.

So I'm switching everything to use the Microsoft.* namespaces. This was easy enough, except for Xamarin.Essentials.Platform.CurrentActivity.

Is there a .Net MAUI equivalent of this class? If not, any other good options other than copying/pasting the code from Essentials into the app?

Saqib
  • 7,242
  • 7
  • 41
  • 55
  • 1
    I think [Microsoft.Maui.Essentials.Platform.CurrentActivity](https://github.com/dotnet/maui/blob/main/src/Essentials/src/Platform/Platform.shared.cs) exists – Andrew Jun 24 '22 at 17:39

1 Answers1

23

All of Essentials got rearranged to go under more logical namespaces. The one you are looking for is now under Microsoft.Maui.ApplicationModel.Platform.CurrentActivity

A full overview, where somehow this one is missing, can be found here: https://github.com/dotnet/maui/pull/5562

Gerald Versluis
  • 30,492
  • 6
  • 73
  • 100