private void Button_Click_SendLog(object sender, RoutedEventArgs e) { if (PrintToConsoleEvent != null) { PrintToConsoleEvent.Invoke(null, new PrintToConsoleEvent() { Text = TextBoxPrintToConsole.Text, }); } }
/// <summary> /// If another user controller wants to print to the console use a event. /// </summary> /// <param name="sender"></param> /// <param name="printToConsoleEvent"></param> private void OnPrintToConsoleEvent(object sender, PrintToConsoleEvent printToConsoleEvent) { if (printToConsoleEvent == null) { return; } if (string.IsNullOrEmpty(printToConsoleEvent.Text)) { return; } PrintToConsole(printToConsoleEvent.Text); }