09-18-2017 10:45 AM
HI,
I have a existing Winforms applications and many of the NI controls such as Scatter Graphs, WaveForm Graphs, Intensity Graphs etc have been utilized to build a engineering application. Currently I am working on the same project but I am tasked to rewrite the above project in WPF.
I am not able to quite identify or match the properties of various NI graphs/controls that have been used in Winforms to that of WPF.
for eg: Caption property of Scatter Graph, I cannot find a similar property when I am using the equivalent Graph in WPF. Do we have any kind of documentation which helps me to understand or identify the equivalent properties of the graphs/controls from Winforms to that of WPF?
09-18-2017 01:42 PM
Although the Measurement Studio WPF controls were guided by the Windows Forms API, they were built with a focus on fitting in with existing Microsoft WPF controls and patterns. In other words, creating a one-to-one mapping to the Windows Forms controls was not a goal, and I am afraid we do not have any documentation on doing a large-scale port from one UI platform to another (beyond basic control equivalence).
That said, we would be happy to answer any individual questions you have about moving to the WPF controls. For "Caption" in particular, we do support label properties on individual graph elements (e.g. Plot.Label
and Scale.Label
). To add a label to an entire control, you can use the WPF Label
control.
09-18-2017 01:50 PM
I agree it may not be possible to map one UI to another UI 🙂
Anyway, I could not find the Label property for a Graph. Is there any property in WPF?
Winforms have the caption property for the Scatter/WaveForm graph to give a title I am not finding any equivalent for it in WPF.
09-18-2017 02:02 PM
You are correct: there is no property equivalent for the Windows Forms graph-level Caption property. WPF has a dedicated Label
control that suits this purpose, so it was not incorporated into the WPF graph API.
09-18-2017 02:04 PM
Ok Paul. sounds good. I will used the Label control on top of the graph to provide a title.
I appreciate you on providing quick answers and replies to post. Keep up the great work.
09-18-2017 02:22 PM
Happy to help!
09-19-2017 08:04 AM
Hi,
What is the equivalent of AfterMoveCursor event of IntensityGraph in Winforms with that of WPF?
I am not able to locate a WPF event which occurs after a cursor has been moved on the Intensity Graph.
09-19-2017 09:09 AM
I believe the PositionChanged
event on the cursor is the most direct equivalent.