consolecontrol
consolecontrol copied to clipboard
Stopping process throws error
calling consoleControl.StopProcess(); from a wpf button or stopping the process from within the process causes an error in the following function.
<ConsoleControl.xaml.cs> public bool ShowDiagnostics { get { return (bool)GetValue(ShowDiagnosticsProperty); } set { SetValue(ShowDiagnosticsProperty, value); } }
An unhandled exception of type 'System.InvalidOperationException' occurred in WindowsBase.dll
Additional information: The calling thread cannot access this object because a different thread owns it."
Very nice library, but i'm having the same issue.
foreach(ConsoleControl.ConsoleControl console in cmds.Keys) {
if (console.IsProcessRunning) console.StopProcess();
// some console.StartProcess code...
}