title: Accessing a singleton class in c# with this;
body: <p>While searching for ways to get an instance of a singleton class i found many different approaches (some simple, some convoluted) but when messing around i found a way to do it which i didn't find anywhere else.</p>
  
  <p>So what i basically do is:</p>
  
  <pre><code>public class Foo
      { 
         public static Foo Invoker;
         public Foo() 
         {
            Invoker = this;
  
         }
         public void Method1()
         { 
           //.....
         }
      }
  </code></pre>
  
  <p>And then from another class</p>
  
  <pre><code>public class Foo2
      { 
  
         public Foo2() 
         {
            //.....
  
         }
         public void Main()
         {
            var foo = Foo.Invoker;
            //or
            Foo.Invoker.Method1();
         }
      }
  </code></pre>
  
  <p>My app is single threaded so i don't care about thread safety (should i?) , so are there any other problems that this approach could cause that i am missing?</p>