Expose RelatedCurrencyManager.UseParentCurrentChanged to CargoWise + unit tests#32
Draft
Copilot wants to merge 3 commits into
Conversation
…elatedCurrencyManager unit tests
…urrentChanged docs
Copilot
AI
changed the title
[WIP] Remove reflection-based hack for CurrencyManager refresh
Expose RelatedCurrencyManager.UseParentCurrentChanged to CargoWise + unit tests
Jun 19, 2026
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
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.
The
BindingContextlist-manager storage is now aDictionary<HashKey, WeakReference>in .NET 10, making CargoWise'sZBindingContextreflection hack (which swappedRelatedCurrencyManager's parent event subscription fromCurrentItemChanged→CurrentChanged) non-viable. The base branch already added the opt-in staticRelatedCurrencyManager.UseParentCurrentChanged; this PR wires it up for external consumption and validates it.Changes
AssemblyInfo.cs— Adds a placeholderInternalsVisibleTo("WiseTech.CargoWise")entry so the CargoWise assembly can setRelatedCurrencyManager.UseParentCurrentChanged. Includes a// TODO:comment requiring the real assembly name and strong-namePublicKey=to be confirmed before merge.RelatedCurrencyManager.cs— Expands the XML docs onUseParentCurrentChangedto clarify event semantics (CurrentItemChangedfires on both position changes and item-property edits;CurrentChangedfires only on position changes) and adds a concreteZBindingContextusage example:RelatedCurrencyManagerTests.cs(new) — Seven tests covering: default value isfalse; default mode refreshes child onCurrentItemChanged-only trigger (BindingList.ResetItem); opt-in mode suppresses that refresh; both modes refresh on position change; no double subscription from cache hits; rebind unwires cleanly with no stale subscription. All tests save/restore the process-wide static intry/finally.Open item
The
InternalsVisibleToentry needs the real CargoWise assembly name and strong-name public key before this is production-ready. A key-less entry (any assembly namedWiseTech.CargoWisecan access internals) is acceptable only for a draft.