WPF vs WinForms: Differences? Common API?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
flobadob
Newbie
Newbie
Posts: 7
Joined: Tue Oct 24, 2017 12:00 am

WPF vs WinForms: Differences? Common API?

Post by flobadob » Mon Oct 30, 2017 2:22 pm

Hi, we have a winforms chart implementation which uses a fairly old steema tchart. We now have a requirement to implement the same charts with WPF. I notice that the WPF tchart seems to use a more conventional method for passing data into the API, rather than using databinding so perhaps the APIs are the same? Is there a common interface between the two (winforms / wpf) and could you please also let me know what features are different between the two? Is one just a wrapper? Thanks.

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: WPF vs WinForms: Differences? Common API?

Post by Christopher » Tue Oct 31, 2017 8:37 am

Hello,

TeeChart.dll (WinForms) and TeeChart.WPF.dll do share a common API - in fact, every effort was made to ensure the API of these two versions of TeeChart were as identical as possible. The WPF TeeChart is not a wrapper of the WinForm TeeChart, it is a native WPF control although it has no design-time capabilities - these design-time capabilities of WPF are available through a separate assembly which is a wrapper, TeeChart.Xaml.WPF. This is the biggest difference between the two versions of TeeChart - the WinForm TeeChart has its design-time capabilities built-in, whereas the design-time capabilities of the WPF are available through a separate assembly.

In terms of porting code from WinForms to WPF, however, this poses no impediment. Given the similarity of the API, and given the fact that WinForms writes its design-time code out as native API, then transferring code from WinForms to WPF proves to be a simple exercise.

If you have any further questions or doubts, please don't hesitate to ask me.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

flobadob
Newbie
Newbie
Posts: 7
Joined: Tue Oct 24, 2017 12:00 am

Re: WPF vs WinForms: Differences? Common API?

Post by flobadob » Fri Nov 03, 2017 1:29 pm

Hi Christopher,

I've written my WPF variant of our existing winforms TeeChart code and yes, it's almost identical apart from things like the color types. However, the TeeChart.TChart type and the TeeChart.WPF.TeeChart types, although sharing almost identical public methods do not (as far as I can see) expose a common interface. So they must be treated in code as if they were completely different types. So yes, migrating my code from the winforms to the WPF tchart was really easy (great) but it would be nice if there was an ITChart interface. I think you might need to have an IColor interface to wrap up the two color types but that's maybe it.

regards,
K

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: WPF vs WinForms: Differences? Common API?

Post by Christopher » Mon Nov 06, 2017 8:33 am

Hello K,

You're quite right - the TChart class of TeeChart.dll and TeeChart.WPF.dll do not derive from the same interface, I'm sorry if I gave you the impression that they did.
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Post Reply