Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1071693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T20:44:53+00:00 2026-05-16T20:44:53+00:00

I want a class (called PremiseServer) in my Mvvm-Light solution (WP7) to subscribe to

  • 0

I want a class (called PremiseServer) in my Mvvm-Light solution (WP7) to subscribe to all property changes for classes that are derived from a base type (SysObject is the base class and it derives from ViewModel).

I have a set of classes derived from SysObject. These classes have various properties on them of differing types (Strings, booleans, ints etc…).

When any property on any of these classes changes I want my PremiseServer instance to see these changes and then make web-service calls to push the data to a server.

I have tried this and it never gets called (which makes sense to me now; because the property that is getting changed is not SysObject, but some property OF the SysObject):

Messenger.Default.Register<PropertyChangedMessage<SysObject>>(this, (action) => {
    String location = ((SysObject)action.Sender).Location;  // URL to POST to
    Debug.WriteLine("PremiseServer PropertyChange - " + action.NewValue.ToString());
});

I also tried the below (registering String messages) and it works, but I don’t want to create one of these for each property type:

Messenger.Default.Register<PropertyChangedMessage<String>>(this, (action) => {
    String location = ((SysObject)action.Sender).Location;  // URL to POST to
    Debug.WriteLine("PremiseServer PropertyChange - " + action.NewValue.ToString());
});

I also tried Register<PropertyChangeMessage<Object> thinking I’d see messages for all derived types (I didn’t).

What I really want is “Register for all property change messags from any property of objects of class SysObject”. How can I do that?

Thanks!

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T20:44:54+00:00Added an answer on May 16, 2026 at 8:44 pm

    You can register for PropertyChangedMessageBase using the Register method overload that has a boolean flag as the last parameter, and setting this flag to true. Like its name shows, this flag allows you to register for a message type, or all messages deriving from this type.

    Note that in the handler, you will need to cast the message to the exact type that you want to handle.

    Does it make sense?
    Cheers,
    Laurent

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my class I want to declare an event that other classes can subscribe
I have a class called EditMapUtilities. Here are some class properties that I want
Basically, what I want to do is create a class called Variables that uses
I have a class called Menu and inside that class I want to place
I have a little class called Stuff that I want to store things in.
I have a base class called Component which has a number of classes derived
I have one class called HyperlinkEventMonitor that implements a HyperlinkListener. I want to extend
I have a container class (called Atom) that I want to store objects of
I want to bind a function to all links with a class called 'click'
I have a class called TASKS. I want one property of the class to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.