Purpose of the WPF branch

Topics: User Forum
Mar 15, 2013 at 5:23 PM
I know that "blah38621" has done a lot of work recently with creating and updating the WPF version of ScintillaNET, but I'm a bit confused about what the purpose of it is exactly. He admittedly isn't a WPF user, and I don't see any work to convert the standard properties to dependency properties for use in MVVM binding. That to me would be the main reason for a WPF version. But maybe I'm missing something.

Don't get me wrong, though. I really appreciate all the work put into it, and the information regarding lexers he's provided. I'm just not sure what I get from modifying my WPF application at this point from using WindowsFormsHost with the WinForms version to using the WPF version.
Mar 16, 2013 at 3:22 AM
Firstly, the WPF control does use a winforms host internally, it's just meant as a wrapper to make using it feel as if it was designed for WPF in the first place. That said, because I don't know how WPF controls are usually designed, I opted for a design that I do know a bit better, MVC 2. I'm currently reading a bit about MVVM binding, and it looks like I should be able to make the control fully bindable with only a few modifications. (you might actually be able to do so now, provided you only use one-way bindings)

Other than the WPF stuff, I've also used it as a staging ground for a few improvements to the capabilities of ScintillaNET, namely the support of managed custom lexers, and the support of named keyword lists (this looks to have been partially done in the trunk, but never completed), and the thing I'm currently working on, a re-write of the configuration system so that it uses reflection rather than manually loading everything. I've also made a few improvements to usability, such as putting together an xml schema for the language configuration files, and adding some description attributes to various properties that were already documented in other ways.
Mar 17, 2013 at 12:44 AM
I appreciate the active development in this project, but I'd like to ask, are the changes you make in the WPF branch going to affect us still using the WinForms branch? Obviously, I don't need the WPF-specific features, but I would like to have the benefits of the other improvements.
Mar 17, 2013 at 5:32 PM
All of the WPF specific features are kept in a separate library, and no changes were made to the WinForms version to add that support, meaning you can use the WPF branch without actually using WPF. Also, I just applied the various bugfixes that were done on the Trunk since the branch was originally created, so, other than my additions, it should be the same as the Trunk.
Mar 17, 2013 at 7:39 PM
blah38621 wrote:
I should be able to make the control fully bindable with only a few modifications. (you might actually be able to do so now, provided you only use one-way bindings)
Adding two way binding for the properties would be great. Having to handle updating and changes in the xaml code behind file is not ideal.
Mar 18, 2013 at 7:29 PM
Thanks, blah38621, I'll switch to the WPF branch. Right now, my application is not WPF (and most likely will not be ported in the near future), but I still would like to take advantage of the lexer fixes you've done.
Apr 24, 2013 at 10:15 AM
Edited Apr 25, 2013 at 7:05 AM
I want to ask on WPF branch. Is it suitable to use in MVVM WPF project? Do you know about any example with binding of ScintillaWPF from ViewModel to View (used with AvalonDock)?
Apr 30, 2013 at 1:38 PM
Unfortunately, I really don't know enough about WPF to be able to answer that. I do however use AvalonDock in the WPF version of SCide, however I use it as you would with WinForms, creating a new control for the dock content, which isn't how it generally is done in WPF.
May 3, 2013 at 3:04 AM
Well I'm still learning WPF and MVVM pattern, but why you need to use MVVM with scintilla? I mean, I'm with a project (with avalondock and scintillanet) and I use MVVM only with avalon. I create a custom view with a scintilla (only from code) and it's display the data as it should, still having trouble to update my main observable collection, (the one that Avalon use to create/delete new documents) with the data each view edit on his custom viewmodel.