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 8681951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:38:30+00:00 2026-06-12T21:38:30+00:00

I have a static class that models a telephone exchange which instantiates Phone Objects

  • 0

I have a static class that models a telephone exchange which instantiates Phone Objects in their own individual windows; the exchange maintains a list of the Phones instantiated and I need a way to “dial” from one phone object into another – For example if I created two phone objects and entered the second phones number into a text box on the first I’d like a property on the second phone to be updated with the first phone (callers) number

I’ve done data binding but I’m new to INotifyPropertyChanged, here’s what I have:

Phone class:

 public class Phone : INotifyPropertyChanged
{
    private string _receivedNumber;
    public Phone(string phoneNumber)
    {
        PhoneNumber =  phoneNumber;
    }

    public string PhoneNumber
    {
        get;
        set;
    }



    public string Status
    {
        get;
        set;
    }

    public string ReceivedNumber
    {
        get { return _receivedNumber; }
        set
        {
            _receivedNumber = value;
            OnPropertyChanged("ReceivedNumber");
        }
    }

    private void OnPropertyChanged(string receivedNumber)
    {
        if (PropertyChanged !=null)
        {
            PropertyChanged(this, new PropertyChangedEventArgs(receivedNumber));
        }
    }


    public event PropertyChangedEventHandler PropertyChanged;
}

}

Here is the logic in my PhoneWindow.xaml.cs, once the call button is clicked on the first phone the phone it wants to connect to is assigned to the Phone object (receiver) from my Exchange list (if it exists) – By now the two objects are instantiated and both displaying in their own windows.

I set the second phone ReceivedNumber property to the caller and here’s where I’m unsure, how do I update the binding/context to reflect the caller number on the second Phone object?

 private void BtnCallClick(object sender, RoutedEventArgs e)
    {
        string number = txtDialNumber.Text;
        if (String.IsNullOrEmpty(number) || !IsNumeric.IsValidNumber(number) || Exchange.RetrievePhone(number) == null)
        {

            MessageBox.Show("The number entered is not valid or the phone doesn't exist");
            return;
        }
        Phone receiver = Exchange.RetrievePhone(number);
        receiver.ReceivedNumber = _phone.PhoneNumber;
        receiver.PropertyChanged += //<--  How to implement this?




    }

Many thanks

  • 1 1 Answer
  • 0 Views
  • 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-06-12T21:38:31+00:00Added an answer on June 12, 2026 at 9:38 pm

    I wrote a ModelBase Abstract Class for MVVM models that allows the ability to subscribe to properties.

    You can find that here:
    http://xcalibur37.wordpress.com/2012/02/06/creating-a-viewmodel-base-part-iii-subscribing-can-make-all-the-difference/

    It would work like this:

    myModel.Subscribe("MeterReading", obj => MyActionThatDoesStuff());
    

    So, if 2 different ViewModels subscribed to myModel.MeterReading, they could both receive updates if the property is changed.

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

Sidebar

Related Questions

I have a static class that I use as my Data Utils for my
I have a static class that looks like this: namespace Argus { static class
So I have a static class that is supposed to be used as a
I have a static util class that does some string manipulation on a bit
Suppose I have a static method of my class that returns an object of
I have a static methods class, Utils, that is basically for utility methods, its
I have class A such that: class A { static int i; A(); f1();
I currently have a helper class that I am using to obfuscate a static
Let's say I have a class (not a static class), A , that in
I'm working with Progress 10.1c I have a class that contains both static and

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.