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

  • Home
  • SEARCH
  • 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 7697655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:04:00+00:00 2026-05-31T22:04:00+00:00

I have a class that instantiates two classes which implement interfaces. I want one

  • 0

I have a class that instantiates two classes which implement interfaces. I want one class to notify another class that something is OK. I could do it with an Action and then use private variables in the class but wondered if there was a direct way of doing it with properties so that when a property’s value changes it updates a property on another class.

For example:

public class MyClass
{
  public ILogger Logger {get;set;}
  public ILogic Logic {get;set;}

  private Form MyWinform;

  public void Setup()
  {
    MyWinform = new MyWinform();
    MyWinform.StartBatch += Logger.CreateFile; //Create file when user presses start

    //How can I set a property on ILogic to be AllOk once ILogger says so??

    //I could use an Action so that once all is ok I call IDecidedAlOK in ILogger which
    //can then assign a private bool variable inside the class

    Logic.ItsOKMethodSoSetVariableToTrue = Logger.IDecidedAllOKMethod;

  }

  public void DataIn(string Value)
  {
     Logic.DataIn(Value);
  }

  public void CreateInstances()
  {
     Logger = new FileLogger();
     Logic = new MyLogic();
  }

}

public class MyLogic : ILogic
{
   public void DataIn(string Value)
  {
     //I want to check that all is ok before I do anything

     //if (!AllOK) 
     //return;

     //Do stuff
  }
}
  • 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-05-31T22:04:01+00:00Added an answer on May 31, 2026 at 10:04 pm

    Implement INotifyPropertyChanged interface and subscribe to PropertyChanged event

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

Sidebar

Related Questions

I have a class that I want to use to store properties for another
Let's say I have two classes that look like this: public class ByteFilter {
I have two different classes deriving from one base class. They each have a
I have a singleton class that implements two other abstract classes. My monkey::getMonkey fails
Say I have a method, and within that method it instantiates a Person class:
I have class that represents users. Users are divided into two groups with different
I have a two classes, a controller called AppController and a class called URLDelegate
I have two classes, a Teacher class and a Student class. In my program
Okay, so I have two classes, call them A and B--in that order in
Obviously, autoloading classes with absolute namespaced names (\One\Two\Three) that translate to actual directory paths

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.