CEF3: Consider dropping the WinForms control
This isn't as controversial as it seems; it's quite easy to host WPF controls in a Windows Forms app. However, I do feel that with the current level of stability, and maturity of the example app (for example), the Windows Forms control doesn't really do CefSharp3 justice. It would be better (IMHO) to just drop it, and instead recommend people to just use WPF. If they must use it in a WinForms application, the link in this issue would be the solution.
What does the rest of you feel about this? Good idea or bad?
I think the alternative would be for someone to really dig into the WinForms code, try to make it good and so on (a little bit like I've been doing with the WPF one), but this hasn't really happened thus far. I don't use WinForms personally, frankly I hate it. :smiley: So it's very unlikely that I will take some of my small amount of time and dedicate it on something like that.
+1 get rid of winforms is a great idea.
-1 Winforms is the only windows desktop technology still alive. WPF has stopped his evolution, and using a WPF in a winforms app introduces undesirable/unneeded dependencies.
@jorgeleo good points. The only problem is that we don't really have anyone working on making the WinForms stuff stable & usable enough. Do you volunteer? If not, I'm afraid your vote cannot be counted; we cannot really ship stuff that doesn't work, it's worse than not shipping it at all IMHO.
I'll make sure that I can build before I commit to maintain it
:smile: Good point...
@jorgeleo Btw, what do you mean with "undesirable/unneeded dependencies"? Is this really a problem in reality, or is just that it "feels" bad? I mean, WPF is a part of the normal .NET Framework; it's not like you would ever run into a machine where only .NET/Windows Forms is available and not .NET/WPF is there...
I think it sounds more like you don't happen to "like WPF" (which I can accept) than a factual argument, if you ask me. Do you see my point?
I'd like to double down on jergeleo's point. Firefox's main support for this type of library is GeckoFx, which is based ontop of a winform control. Since both Gecko and IE therefore have winform controls, I'm willing to bet that most places that are in need of something like this for chrome already have existing technology built on winforms.
@RobertChrist, I see your point - but you shouldn't neglect the fact that we're not only dealing with "old", existing applications here, but also new applications needing to integrate web content (and new applications might as well be written in WPF rather than WinForms). The app which I use myself, which triggered me to start contributing to CefSharp in the first place, is a WPF app, and I think it's important to remember that CefSharp is especially important for WPF (since i.e. the IE web control doesn't support transparency properly, for example).
Also, I haven't really seen any hard facts as to what the problem would be to say to WinForms people that they can use the WPF control and host it in an ElementHost? It doesn't really add any extra dependency to your app; all the required WPF assemblies are included in the .NET Framework anyway...
Let me put it like this: which is worst, having a low-quality Windows Forms control (that will harm the reputation of the project), or having no Windows Forms control at all (and suggesting people use the ElementHost-based approach)? I tend to lean toward the latter.
If you (@RobertChrist or @jorgeleo, or anyone else for that matter) feel like contributing time to make the Windows Forms control (in CefSharp3, that is) + also the WinForms example be of equal quality as the WPF control & example - be my guest. I'm not against it, not at all. But since there aren't really that many people willing to contribute time to make the Windows Forms excel, perhaps that's a sign in itself also...?
Food for thought. Please prove me wrong; I like to be a bit provocative you know... :smiley:
You can only do what you can do, right? Every project has limitations.
I would absolutely be happy to whip the cef3 winform example into shape, or, in general, lend my hand anywhere c# development is needed. I haven't dabbled in C++ since early college, however, so I'm not sure how much help I can be to you in developing CefSharp3 overall.
@RobertChrist (and others with interest in seeing CefSharp3 with solid WinForms support) that really would be great!
Note: Not only the CefSharp.WinForms.Example but also CefSharp.WinForms project https://github.com/cefsharp/CefSharp/tree/v3.29.0-pre.0/CefSharp.WinForms is C# code. The primary reason the project looks like it is has a high amount of C++ is that the upstream CEF API code also lives in the repo. In addition several of the C++ projects in CefSharp1 has been converted to C# so don't be scared too much by the C++ label on the project.
I think the first step would be to try and get the WinForms example anywhere near looking the same as the WPF example. I.e. "execute script", "evaluate scrpit" etc. buttons to the right. I'm not that excellent at Windows Forms though, so I could really take some help there.
Also, getting trivial stuff like the Enter key working for navigating to a URL should be a fairly simple task to fix... :smiley:
With a few changes like these + the stability fix (#214) I think we are pretty close to making CefSharp3 for WinForms be "ready for general use".
@perlun, if you don't already have someone working on this, I can try working on it. I'm developing a WinForms application using CefSharp currently, and was excited to see CEF 3 support coming.
If there was more documentation about how the multiprocess works with CefSharp 3 (and if there is I couldn't find it!) I can modify it to be a tabbed browser.
@jothousand, great news! I created a separate issue for it #279 - let's continue the discussion there. We should also try and get #236 sorted I feel.
Heyo! I haven't forgotten about this. I'm pretty slammed for the next ~2 weeks or so, am hoping to start looking at this after that.
Rob
On Tue, Mar 18, 2014 at 4:28 PM, Per Lundberg [email protected]:
@jothousand https://github.com/jothousand, great news! I created a separate issue for it #279https://github.com/cefsharp/CefSharp/issues/279- let's continue the discussion there. We should also try and get #236 https://github.com/cefsharp/CefSharp/issues/236 sorted I feel.
— Reply to this email directly or view it on GitHubhttps://github.com/cefsharp/CefSharp/issues/241#issuecomment-37983386 .
Heyo! I haven't forgotten about this. I'm pretty slammed for the next ~2 weeks or so, am hoping to start looking at this after that.
Sounds good! "You're our last hope, Obi-Wan!"
Hi. I am building new app. I did not know WinForms was being deprecated. How could I host a WPF view in winforms?
@perlun I'm happy to commit some time to getting WinForms up to scratch. PR #349 gets the basics working.
I think with #349 now merged we can reduce the considerations mentioned in the title of this issue somewhat :stuck_out_tongue_winking_eye: @amaitland turned out to be our Obi-wan for the groundwork on this. Thanks mate!
Those with an interest in WinForms please take latest master branch for a test drive and voice your opinion on if you think it is ready - and if it's worthy for considering to cut a (prerelease?) WinForms NuGet?
See the ”Building CefSharp from source” if you need some details on how.
I'll leave this issue open for input ...
@treeform welcome to CefSharp! See the link in https://github.com/cefsharp/CefSharp/issues/241#issuecomment-40107198.
There might still be uses for embedding Wpf in WinForms as it uses the offscreen rendering path in the upstream CEF which has somewhat different behavior. E.g. it has easy support of graphics transforms with opacity etc. as illustrated by the WPF example application.
We'd like WinForms with latest. It's saves a major re-write for us...