From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Migrating NI Controls from WinForms to WPF

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?

 

0 Kudos
Message 1 of 8
(2,991 Views)

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.

~ Paul H
0 Kudos
Message 2 of 8
(2,969 Views)

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.

0 Kudos
Message 3 of 8
(2,966 Views)

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.

~ Paul H
0 Kudos
Message 4 of 8
(2,962 Views)

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.

0 Kudos
Message 5 of 8
(2,960 Views)

Happy to help!

~ Paul H
0 Kudos
Message 6 of 8
(2,956 Views)

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.

0 Kudos
Message 7 of 8
(2,942 Views)

I believe the PositionChanged event on the cursor is the most direct equivalent.

~ Paul H
0 Kudos
Message 8 of 8
(2,939 Views)