Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>neither view model or view model base are subscribing to the PropertyChanged event. So therefore, neither of these objects will receive the event notification when its raised by DIPREDIPForView.</p> <p>presumably DIPREDIPViewModel needs to subscribe to PropertyChanged on DIPREDIPForView, and the event subscription needs to point to the OnPropertyChanged event handler on BaseViewModel .</p> <p>Not sure if this is what you are looking for.</p> <p>Here is a sample...</p> <pre><code>[Test] public void TestEventIsRaised() { TestEventSubscriber subscriber = new TestEventSubscriber(); subscriber.SetFirstName("joe"); Assert.IsTrue(subscriber.EventWasHandledInTestDouble); } public class TestEventSubscriber : EventSubscriber { public bool EventWasHandledInTestDouble; public TestEventSubscriber() { } protected override void OnMyEvent(object sender, EventArgs args) { EventWasHandledInTestDouble = true; } } public class EventSubscriber { private EventRaiser eventRaiser = new EventRaiser(); public EventSubscriber() { eventRaiser.MyEvent += (sender, args) =&gt; { Console.Write("Event was handled via anonymous delegate"); }; eventRaiser.MyEvent = OnMyEvent; } public void SetFirstName(string firstName) { eventRaiser.FirstName = "bob"; } protected virtual void OnMyEvent(object sender, EventArgs args) { Console.WriteLine("Event was handled via virtual method..."); } } public class EventRaiser { public EventHandler MyEvent; public EventRaiser() { } private string firstName; public string FirstName { get { return firstName; } set { firstName = value; EventHandler handler = this.MyEvent; if (handler != null) MyEvent(this, EventArgs.Empty); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload