Page 1 of 1
PenEditor in WPF
Posted: Mon Jan 07, 2013 12:43 pm
by 15662757
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.
Re: PenEditor in WPF
Posted: Mon Jan 07, 2013 3:04 pm
by 10050769
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,
Re: PenEditor in WPF
Posted: Mon Jan 07, 2013 4:04 pm
by 15662757
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,
Re: PenEditor in WPF
Posted: Tue Jan 08, 2013 4:44 am
by 15662757
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
Re: PenEditor in WPF
Posted: Tue Jan 08, 2013 3:07 pm
by 15662757
Hope someone is looking into this issue.
Thanks
Re: PenEditor in WPF
Posted: Tue Jan 08, 2013 5:08 pm
by 10050769
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,
Re: PenEditor in WPF
Posted: Wed Jan 09, 2013 8:00 am
by narcis
Hi asupriya,
You may also be interested in using the Color Picker control from the Extended WPF Toolkit:
https://wpftoolkit.codeplex.com/wikipag ... olorPicker