title: Porting a console application to WPF
body: <p>I have created a small chatting application in C#, and started as a Console Application. However I want to create a GUI for it using WPF. It's a class named <code>DanMessengerClient</code>with functions such as <code>InitializeConnection()</code>, <code>SendMessage(string msg)</code>, etc.</p>
  
  <p>I have already designed the UI in Visual Studio, and it created it's <code>Window1</code> class on Window1.xaml.cs by default. I created an event handler for the "Send" button that only appends some dummy text to a textarea as of now. My question is, <strong>how should I call the SendMessage() function from the WIndow1 class?</strong></p>
  
  <p>I tried creating the object in that class, but since I also need to access the Textbox from inside the first class (i.e. When  I recieve a message, update the textbox), adding the reference to the Window1 class throws a <code>StackOverflow</code> exception because it keeps creating references in an infinite loop.</p>
  
  <p>I'm new to GUI applications. How should I proceed?</p>