Skip to content

WI01076374 - Currency Manager .NET10 Fix#20

Open
FahmiFuzi wants to merge 1 commit into
masterfrom
FFZ/WI01076374/CurrencyManager.Net10Fix
Open

WI01076374 - Currency Manager .NET10 Fix#20
FahmiFuzi wants to merge 1 commit into
masterfrom
FFZ/WI01076374/CurrencyManager.Net10Fix

Conversation

@FahmiFuzi
Copy link
Copy Markdown

@FahmiFuzi FahmiFuzi commented May 28, 2026

This pull request introduces extensibility improvements to the data binding infrastructure in Windows Forms, specifically targeting how BindingContext manages its internal collection of BindingManagerBase instances. The main goal is to allow subclasses to customize behavior when a new binding manager is added, and to expose a helper for re-wiring parent-child event handlers in related currency managers. This refactoring makes it easier for downstream consumers (such as custom binding contexts) to implement advanced scenarios without modifying the base collection logic.

Extensibility for binding manager addition:

  • Added a new protected virtual method OnListManagerAdded(BindingManagerBase bindingManagerBase) to BindingContext, which is invoked whenever a new BindingManagerBase is added or refreshed. The default implementation is a no-op, allowing subclasses to override and inject custom logic at this point.
  • Updated EnsureListManager in BindingContext to call OnListManagerAdded after adding a new manager.

Helpers for advanced event wiring:

  • Introduced a protected static helper method RewireRelatedCurrencyManagerParent(BindingManagerBase bindingManagerBase) in BindingContext. This method allows subclasses to rewire parent event subscriptions for related currency managers, supporting scenarios previously handled by custom hashtable logic in .NET Framework. [1] [2]
  • Added the internal method RewireParentChangeHandler() to RelatedCurrencyManager, which detaches and re-attaches the correct parent event handlers and primes the child manager with the parent's current state. This supports the new extensibility point in BindingContext.

Public API surface:

  • Registered the new methods BindingContext.OnListManagerAdded and BindingContext.RewireRelatedCurrencyManagerParent in the public API file.

@FahmiFuzi FahmiFuzi changed the base branch from main to master May 28, 2026 20:00
@FahmiFuzi FahmiFuzi changed the title Ffz/wi01076374/currency manager.net10 fix WI01076374 - Currency Manager .NET10 Fix May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant