-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
Lead Maintainer for the .NET MAUI Community Toolkits here!
In Microsoft.Maui.Controls v10.0.40, InternalsVisibleTo was revoked for the .NET MAUI Community Toolkits in this PR: #33442
I agree with removing InternalsVisibleTo for the .NET MAUI Community Toolkits because it has caused many headaches and bugs for both us maintainers and developers using the CommunityToolkit.Maui.* libraries.
I was told this was going to be implemented in the .NET 10 release of Microsoft.Maui.Controls, v10.0.0, and that the .NET MAUI team would ensure that the internal APIs used by the .NET MAUI Community Toolkits would be promoted to public. I was unaware of the PR that made this change and I wish someone from the .NET MAUI team had reached out to me directly to help test it.
This has broken the following features in the .NET MAUI Community Toolkits:
CommunityToolkit.Maui.MarkupCommunityToolkit.Maui.ExpanderCommunityToolkit.Maui.AvatarViewCommunityToolkit.Maui.AppThemeObjectCommunityToolkit.Maui.SnackbarCommunityToolkit.Maui.GravatarImageSourceCommunityToolkit.Maui.AppThemeResourceExtensionCommunityToolkit.Maui.ImageTouchBehaviorCommunityToolkit.Maui.TouchBehaviorCommunityToolkit.Maui.StateContainer
Below are the public APIs the .NET MAUI Community Toolkits use that should be promoted to public:
Classes
class StreamWrapperclass FontElementclass TextElementclass ImageElementclass AppThemeBindingsealed class BindingExpressionsealed class WeakPropertyChangedProxystatic class DispatcherExtensionsinternal readonly struct SetterSpecificity
Interfaces
interface IResourcesProvider
Constructors
internal XamlParseException(string, IServiceProvider serviceProvider, Exception)internal TypedBindingBase()
Methods
VisualElement.InvaldateMeasureInternal(InvalidationTrigger);
Properties
private protected CancellationTokenSource CancellationTokenSource { get; private set; }
Extension Methods
internal static double GetDefaultFontSize(this Element);internal static void BindableLayout.Remove(this IBindableLayout, object);internal static void BindableLayout.Add(this IBindableLayout, object);internal static IFontManager RequireFontManager(this Element, bool);internal static T? GetTargetOrDefault<T>(this WeakReference<T>)
My ask is that these APIs be promoted to public. I'm also happy to chat about work-arounds for these APIs if the team finds that they cannot (or should not) be promoted to public.
In the future, please work with me directly when there may be impacts to the .NET MAUI Community Toolkits.
Steps to Reproduce
- Download/clone the reproduction sample: https://github.com/TheCodeTraveler/Community-Toolkit-Reproduction-for-Microsoft.Maui.Controls-v10.0.40-/tree/main
- Build/run the reproduction sample on an Android emulator or device
- In the reproduction sample, navigate to
Layouts->Expander Page - Confirm sample crashes
- In the reproduction sample, navigate to
Views->AvatarView Bindable Properties Page - Confirm sample crashes
- In the reproduction sample, navigate to
Extensions->AvatarView Keyboard Page - Confirm sample crashes
- In the reproduction sample, navigate to
Essentials->AppTheme Page - Confirm sample crashes
- In the reproduction sample, navigate to
Alerts->Snackbar Page - Confirm sample crashes
- In the reproduction sample, navigate to
ImageSources->GravatarImageSource Page - Confirm sample crashes
- In the reproduction sample, navigate to
ImageSources->GravatarImageSource Page - Confirm sample crashes
- In the reproduction sample, navigate to
Behaviors->Touch Behavior Page - Confirm sample crashes
- In the reproduction sample, navigate to
Layouts->State Container Page - Confirm sample crashes
Link to public reproduction project repository
Version with bug
10.0.40
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
10.0.30
Affected platforms
Android, iOS, Windows, macOS
Affected platform versions
All
Did you find any workaround?
Downgrading to Microsoft.Maui.Controls v10.0.31 allows developers to continue using CommunityToolkit.Maui