PenEditor in WPF

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asupriya
Newbie
Newbie
Posts: 8
Joined: Mon Jun 18, 2012 12:00 am

PenEditor in WPF

Post by asupriya » Mon Jan 07, 2013 12:43 pm

We are migrating .net V3 to WPF v4 and having issues with Editors.

How do i declare following statement for WPF?

Dim editor1 As New Steema.TeeChart.Editors.PenEditor(fastlineseries1.LinePen)

We also have editors related code for print preview, export to PNG. Please give us a sample code where all these editors can be accessed via WPF TChart.

Any help is much appreciated.

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: PenEditor in WPF

Post by Sandra » Mon Jan 07, 2013 3:04 pm

Hello asupriya,

You need know that TeeChart.WPF doesn't support XAML designtime surfaces. You can place a TChart in a XAML page at designtime, but you cannot do any editing on the TChart objects or properties using XAML. This has been so since the existence of TeeChart.WPF. Therefore, if you want that TeeChart have same funcionalities, in WPF that in Winforms you can achieve same results without problems, if you work in runtime.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

asupriya
Newbie
Newbie
Posts: 8
Joined: Mon Jun 18, 2012 12:00 am

Re: PenEditor in WPF

Post by asupriya » Mon Jan 07, 2013 4:04 pm

Sandra,

I am creating the editor as a response to double-click on fastline series on a tchart object that was created at runtime.

Can you post some sample code to show how a user can change the color of a fastlineseries at runtime?

Thanks,

asupriya
Newbie
Newbie
Posts: 8
Joined: Mon Jun 18, 2012 12:00 am

Re: PenEditor in WPF

Post by asupriya » Tue Jan 08, 2013 4:44 am

Here is the code to show that tee chart handle is grabbed from an event

'if the selected part is a series then
' opens the trace editor dialog for changing the styles,colors of a series
' and then updates the graph colors etc.,

Code: Select all

If (selectorPart.Part = Steema.TeeChart.WPF.ChartClickedPartStyle.Series) Then
                    Dim s As Steema.TeeChart.WPF.Styles.FastLine = CType(selectorPart.ASeries, Steema.TeeChart.WPF.Styles.FastLine)
                    'do not allow color change for digitals
                    If s.Tag(_CHNLTYPE_) = _DIGITAL_BITS_ Then
                        MessageBox.Show("Digital trace color can not be changed.", "Digital trace selected", MessageBoxButton.OK, MessageBoxImage.Exclamation)
                        Exit Function
                    End If
                    Dim prevClr As Color = s.Color

                    'declaring and defining a trace editor for changing the colors of a trace
                    Dim editor1 As New Steema.TeeChart.WPF.Editors.PenEditor(s.LinePen) ====> Problem at this point
                    editor1.Text = "Trace Editor"
                    'if cancel button is clicked then
                    'set the prevoius colors 
                    If Not editor1.ShowDialog() = Windows.Forms.DialogResult.OK Then
                        'restore to prev. color
                        s.Color = prevClr
                        s.LinePen.Color = prevClr
                        Exit Function
                    End If
                    editor1 = Nothing

asupriya
Newbie
Newbie
Posts: 8
Joined: Mon Jun 18, 2012 12:00 am

Re: PenEditor in WPF

Post by asupriya » Tue Jan 08, 2013 3:07 pm

Hope someone is looking into this issue.

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: PenEditor in WPF

Post by Sandra » Tue Jan 08, 2013 5:08 pm

Hello asupriya,

The editors of TeeChartFor.Net aren't supported in TeeChartFor.Net WPF as I have explained in previously post, therefore you can not use it. For this reason, if you want work in WPF project an you want achieve change the color of your FastLine in run time, you only have two options allow you do it. The first is create a Color Editor as explain in this link http://msdn.microsoft.com/en-us/library ... .100).aspx and use it in your TeeChart application. The second is similar of my previous suggestion, but instead of create a Color Editor is implemented a ColorPicket as explain in next link: http://www.codeproject.com/Articles/343 ... er-for-WPF and you only must adapt this, because works in TeeChartFor.WPF application.
On the other hand, If you want migrated without lose funcionalities of your applications, I recommend use winforms version 4.

If you have some problems to implement the Color Editor or ColorPicket please let me know and I try to help you.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: PenEditor in WPF

Post by Narcís » Wed Jan 09, 2013 8:00 am

Hi asupriya,

You may also be interested in using the Color Picker control from the Extended WPF Toolkit: https://wpftoolkit.codeplex.com/wikipag ... olorPicker
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply