+ Reply to Thread
Results 1 to 2 of 2

Thread: listening for property change messages

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    34

    listening for property change messages

    I Need an example of listening for property change messages.
    For example : i got 2 Properties and when one of them changes i`d like to raise an event that notify me with the change like the new value instead of old value.

  2. #2
    Junior Member
    Join Date
    Jan 2012
    Posts
    35
    You need to make a method with switch statements :
    Code:
            MessengerInstance.Register<PropertyChangedMessage<int>>(this, IntReceiver);
    
            RaisePropertyChanged("Change 1", 0, 1, true);
            RaisePropertyChanged("Change 2", 0, 2, true);
    
        private void IntReceiver(PropertyChangedMessage<int> n)
        {
            switch (n.PropertyName)
            {
                case "Change 1":
                    Debug.WriteLine("Change 1:" + n.NewValue);
                    break;
                case "Change 2":
                    Debug.WriteLine("Change 2:" + n.NewValue);
                    break;
            }
        }

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts