Event Bubbling and MVP: ASP.NET

TLDR the code.

Here’s how I would do it.
You say there are 2 controls on the same page. So that can be served by a ContainerVM with references (members) of TimeVM and MonthVM.

  1. TimeVM updates a backing property ResultantDate whenever you do your thing.
  2. ContainerVM has subscribed to property-changed notifications for TimeVM.ResultantDate. Whenever it receives a change notification, it calls MonthVM.SetMonth()

This can now be tested without using any views – purely at the presenter level.

Leave a Comment