title: C#: ClassA to instantiate ClassB so that ClassB can access ClassA properties?
body: <p>From within instance A of ClassA, I instantiate ClassB, which starts a new thread and gets a polling loop going.  Depending on what ClassB finds, I want it to update properties in instance A of ClassA.  Is this possible?  I tried passing "this" to the ClassB constructor with no luck.  I see how I can feed ClassB any number of other class references, I just don't see how to feed it instance A of ClassA.</p>
  
  <p>I will gladly use a different model if it can give me the same theoretical result.  Perhaps this can be done with events?  Many thanks in advance.</p>
  
  <p>My code:</p>
  
  <pre><code>public class xxx
  {
      yyy ggg = new yyy(this); // "this" redlined by C# Express
  }
  public class yyy 
  {
      public yyy(xxx InstantiatedBy)
      {
          MyInstantiator = InstantiatedBy; 
      }
      xxx MyInstantiator = new xxx();
  }
  </code></pre>
  
  <p>Error message is "Keyword 'this' is not available in the current context"</p>