-
Notifications
You must be signed in to change notification settings - Fork 120
Dynamically register proxies/typemap for custom-mapped XAML types #2093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Sergio0694
merged 14 commits into
staging/3.0
from
user/sergiopedri/dynamic-type-map-entries
Nov 1, 2025
Merged
Dynamically register proxies/typemap for custom-mapped XAML types #2093
Sergio0694
merged 14 commits into
staging/3.0
from
user/sergiopedri/dynamic-type-map-entries
Nov 1, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
manodasanW
approved these changes
Nov 1, 2025
3757ab3 to
75ad766
Compare
Introduces the DefineDynamicCustomMappedTypeMapEntries method to handle dynamic type map entries for custom-mapped types in the interop generator. Adds a new well-known exception for errors during this process and updates comments for clarity regarding custom-mapped types.
b0c1b5d to
84d4c68
Compare
Moved WindowsRuntimeComWrappers type map assembly attributes for IEnumerable, IEnumerator, IList, NotifyCollectionChangedEventArgs, and PropertyChangedEventArgs from ABI classes to a new DynamicCustomMappedTypeMapEntriesBuilder in the generator. Updated ABI classes to be obsolete, editor-browsable never, and public static. Added missing type references in InteropReferences for IList, NotifyCollectionChangedEventArgs, and PropertyChangedEventArgs.
This commit updates method signatures and calls to use fully qualified names for types in the ABI.System.Collections and related namespaces. It also removes unnecessary using directives, improving clarity and reducing ambiguity in type references.
Updated several methods in InteropTypeDefinitionBuilder from public to private to restrict their visibility and encapsulate implementation details. This change improves encapsulation and clarifies intended usage within the class.
Extracted repetitive logic for adding type map custom attributes into a new private helper method, TypeMapAttribute, to reduce code duplication and improve maintainability in DynamicCustomMappedTypeMapEntriesBuilder.
Replaces direct marshaller attribute and method references with fully qualified ABI namespace usage throughout the codebase. Also marks BindableIReadOnlyListAdapter as obsolete and updates related attributes for improved clarity and maintainability.
Updated various files to remove unnecessary global:: and ABI namespace prefixes, use direct type references, and improve clarity in XML documentation. Adjusted marshaller and interface references for BindableIReadOnlyListAdapter and Point to use more concise and consistent naming. These changes improve code readability and maintainability.
Introduces WindowsRuntimeExposedType for NotifyCollectionChangedEventHandler, PropertyChangedEventHandler, and BindableIReadOnlyListAdapter in DynamicCustomMappedTypeMapEntriesBuilder. Updates InteropReferences to expose new type references, makes InteropTypeDefinitionBuilder.Proxy public, and refines ABI implementations for these types to remove assembly-level TypeMap attributes and improve marshaller attribute visibility and documentation.
Refactored DefineDynamicCustomMappedTypeMapEntries to accept InteropGeneratorArgs and InteropReferences instead of InteropDefinitions. Updated call sites and XML documentation to match the new parameters, improving clarity and flexibility for dynamic type map entry generation.
Ensure type references and constructors are imported into the current module before resolving or using them. This addresses potential issues with type resolution and attribute instantiation in code generation.
Updated type references for System.Collections.Specialized and System.ComponentModel types to use the new SystemObjectModel assembly reference instead of CorLibScope. Added SystemObjectModel as an assembly reference to improve accuracy and maintainability.
Deleted TypeMap assembly attributes mapping IBindableIterator interfaces to ABI.System.Collections.IEnumerator. This simplifies the mapping configuration and removes references to Windows.UI.Xaml.Interop and Microsoft.UI.Xaml.Interop.
Replaces PropertyChangedEventHandler.CreateTypeReference with SystemObjectModel.CreateTypeReference for INotifyDataErrorInfo, ensuring the correct method is used to create the TypeReference.
…solete Added Obsolete and EditorBrowsable attributes to BindableIReadOnlyListAdapterComWrappersMarshallerAttribute to indicate it is deprecated and should not be used in new code.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR moves the registration of proxy types and type map entries for custom-mapped types that change runtime class names between WUX and MUX to cswinrtgen, so that only the correct things are registered depending on the runtime configuration.