public void DebugWrite(string text)
 {
     DebugLine.Text += text + "\n";
     DebugLine.ScrollToEnd();
 }
 /// Textbox used for debugging
 private void DebugLine_Loaded(object sender, RoutedEventArgs e)
 {
     DebugLine.Text += "loaded\n";
     DebugLine.ScrollToEnd();
 }