dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
723 stars 169 forks source link

WPF console app does not work #25

Open AndrewBragdon opened 7 years ago

AndrewBragdon commented 7 years ago

Great project! The WinForms version works fine, but the WPF version does not work (at least on Windows Server, which is where I am running it on). I am unable to type characters into the window / no input is accepted after starting the console connection.

Thoughts?

gandalf1819 commented 7 years ago

WinForms is working perfectly fine but WPF version is not interacting with the shell. On giving any input, there is no output. Can you help?

danielseis commented 6 years ago

It gives the sensation that this project is abandoned. in wpf you can not make any entry by keyboard. nor dir. nor launch any command. If someone has solved it, I would appreciate the solution. Thank you

adamecr commented 5 years ago

I was looking for ideas how to "make" a WPF console for my project and ended up here - actually I do like the work Dave did, it's nice piece of code with good ideas behind. However I have had issues to make the WPF park working, so I have quite redesigned some parts to make it work. If still somebody interesting in the WPF part, you can check the code within the project I use the console in. The important files for console WPF control are in Console XAML part ProcessWrapper (ProcessInterface here) RichTextBox extensions used

dwmkerr commented 5 years ago

I will take a quick look when I get back home @adamecr! For some reasons I had notifications disabled for this project so I've not been keeping up to date with it. If I can get it working based on your input, are you OK for me to update the code in this repo then credit you as a contributor?

adamecr commented 5 years ago

Hello Dave @dwmkerr , I have found some issue with BackgroundWorker, I have a fix, but just finishing the release of other functionality of my VSIX, so I think, I'll upload the latest code during the weekend (I use the GitHub just as a public mirror of my release branches). Once it's done, I'll get back with more details what I have done to make the console working, so it will make the digging through the code easier. Of course no problem with using my findings/code here.

adamecr commented 5 years ago

So I'm back to summarize the updates I have made to make the control working in WPF. The key part was in ConsoleControl.xaml.cs:

I think these two changes are crucial and the rest are just the improvements and/or adjustments:

The updates to ProcessInterface (I call it ProcessWrapper) are not really game changers:

That's it, hope this helps... Should you have any questions, just raise the comment.

If you want to have a look into my version of code or use the console control itself, you need these files: ConsoleControl.xaml ConsoleControl.xaml.cs RichTextBoxExtensions.cs ProcessWrapper.cs BackgroundWorkerWithSyncCancel.cs

Buddha1996 commented 4 years ago

@danielseis found a solution, posted the fix in i a new Issue.. i know it has been a while since 2018.. Best regards