Skip to content

fix: follow ViewModel inherited from referenced assemblies - #180

Merged
glennawatson merged 1 commit into
mainfrom
CP_follow-referenced-view-model
Oct 13, 2026
Merged

glennawatson merged 1 commit into
mainfrom
CP_follow-referenced-view-model

Conversation

@ChrisPulman

@ChrisPulman ChrisPulman commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Generated interaction bindings follow a public typed ViewModel inherited from a referenced generic view base. Late assignment, replacement, clearing, and disposal now preserve the expected handler lifetime.

Why

Closes #170. External view bases were omitted from the property metadata used to observe ViewModel replacement.

Breaking changes

None.

How this was verified

Exercised real referenced assemblies with task and observable handlers, initially absent and present view models, replacement, clearing, disposal, both runtime flavours, related property and command bindings, and C# 7.3 generated output. Ran the full solution with coverage, a warnings-as-errors build, and all available managed examples. The changed generator file has complete line and branch coverage. Ordinary tests use a common en-US culture, with explicit culture regressions retaining their overrides.

Published and ran the Windows x64 native AOT example using the installed Windows SDK and Visual Studio Enterprise C++ toolchain, with no trim or AOT warnings. Linux and Apple host verification was unavailable.

Notes for the reviewer

The fix projects only the inherited ViewModel property through the existing symbol and notification inspection. General referenced-base scanning remains bounded. This branch is independent of the production fixes in #177 and #179. Companion website PR #1006 documents the activation-time example.

Checklist

  • I have read the contribution guidance.
  • The title follows Conventional Commits.
  • Tests cover the behavior change.
  • Documentation and examples describe the behavior.
  • Changes target main.

- Capture the inherited public ViewModel metadata used by interaction bindings.
- Reuse property notification inspection and preserve member hiding and weakly typed fallback.
- Test referenced generic view bases, late assignment, replacement, clearing, and disposal in both runtime flavours.
- Verify related property and command bindings and C# 7.3 generated output.
- Demonstrate activation-time binding and retain the shared en-US test culture.

Closes #170
@codecov

codecov Bot commented Oct 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.28%. Comparing base (c79c70c) to head (03ea0df).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #180   +/-   ##
=======================================
  Coverage   99.28%   99.28%           
=======================================
  Files         403      403           
  Lines       15033    15035    +2     
  Branches     2229     2230    +1     
=======================================
+ Hits        14925    14927    +2     
  Misses        108      108           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sonarqubecloud

Copy link
Copy Markdown

@glennawatson
glennawatson merged commit e9e4bce into main Oct 13, 2026
24 checks passed
@glennawatson
glennawatson deleted the CP_follow-referenced-view-model branch October 13, 2026 04:26
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.

BindInteraction does not follow ViewModel when the view inherits it from another assembly (e.g. ReactiveUserControl<T>)

2 participants