CommunityToolkit / Maui

The .NET MAUI Community Toolkit is a community-created library that contains .NET MAUI Extensions, Advanced UI/UX Controls, and Behaviors to help make your life as a .NET MAUI developer easier
https://learn.microsoft.com/dotnet/communitytoolkit/maui
MIT License
2.28k stars 404 forks source link

Fix for #2050 [DOC] Update Sample Application to demonstrate correct way to initialize Maps in MauiProgram.cs to support Maps on all platforms. #2325

Closed mikelor closed 2 weeks ago

mikelor commented 2 weeks ago

Description of Change

Demonstrate the correct way to incorporate .Net Maui Maps for Windows into a multiplatform application.

The 2.0.1 Release of the Community Toolkit Maps component introduced a change that requires the #ifdef Windows directive when compiling a multiple platform application with Maps.

This can cause confusion for people trying to incorporate Maps into the application due to the fact that since Maui 8.0.10 now throws an exception on Windows when using the standard Maps component.

No prior tests for this sample code. This code is a sample.

Linked Issues

Did not test on iOS or Mac Catalyst

mikelor commented 2 weeks ago

@bijington the ReadMe.Txt modified in this PR is specific to the Maps assembly. See the current version here

I'd be happy to take a look at the XML docs and add an explanation there as well. Here's what was in the Release Notes for the 2.01 Version that caused my frustration. If the sample was updated or it was in the XML docs for the method, I may have resolved my issue earlier. LoL.

bijington commented 2 weeks ago

That'll teach me for reviewing the changes on my phone and missing that detail. Apologies for that.

That would be brilliant if you could. Thank you

mikelor commented 2 weeks ago

Ok @bijington, when you get a chance take a look. I added some example code to the XML docs. They generated just fine.