title: MainForm access method from another form
body: <p>I want to transform WinForm to WPF as follow code:</p>
  
  <p>Login form:</p>
  
  <pre><code>public partial class Login : Form
  {
      public Login()
      {
          InitializeComponent();
      }
  }
  
  public static XmppClientConnection getXmpp()
  {
      return xmppCon;
  }
  </code></pre>
  
  <p>MainForm:</p>
  
  <pre><code>public partial class MainForm: Form
  {
      XmppClientConnection xmppCon = Login.getXmpp(); // It's okay to access
      public MainForm()
      {
          InitializeComponent();
      }
  }
  </code></pre>
  
  <p>WPF Code:</p>
  
  <pre><code>public partial class MainForm: Form
  {
      XmppClientConnection xmppCon = Login.getXmpp(); // my Login can not access getXmpp method;
      public MainForm()
      {
          InitializeComponent();
      }
  }
  </code></pre>
  
  <p>Error with <code>Login.getXmpp</code> at line: <code>XmppClientConnection xmppCon = Login.getXmpp();</code></p>
  
  <p>My question is, why MainForm can't access method getXmpp from Login form?</p>