01-06-2017 01:13 PM
I am converting a rather large CVI program to run under Visual Studio. NI's conversion wizard worked and after some effort the project runs as it did before. Now I want to take advantage of WPF and do all the UI editing in VS as well. I'm wondering if anyone knows of or has created a way to convert the CVI UIR files into XAML. If so it would save me a bunch of time since my UI is rather complex.
Thanks.
Solved! Go to Solution.
01-09-2017 10:34 AM
Hi aghacker,
There is no way I can find to specifically convert a uir file to XAML. The uir file really can't be used outside LabWindows/CVI environment, so your best bet will probably be creating a new UI in VS. You can save a UIR file in text format:
Options»Save in Text Format
http://zone.ni.com/reference/en-XX/help/370051M-01/cvi/usermanual/uioptionssaveintextformat/
This will give a list of the components on the UI in a readable text format, which may give you a better place to start from.
01-17-2017 04:38 PM
I did as you suggested and converted the UIR file to a TUI file. Then I wrote a CVI program that uses the INI library and the CVIXML library to do some conversion to XAML (VS 2012). It's by no means fully implemented. I only used the controls and attributes that I needed. I did try to make it somewhat extensible so hopefully others can add on as needed. I implemented, at least on a basic level, the control types shown below. I tested it on the UI's I needed and it works fine, but I'm sure there are still bugs. Hopefully the project will help someone else too.
CTRL_TABLE_LS
CTRL_SQUARE_COMMAND_BUTTON_LS
CTRL_NUMERIC_LS
CTRL_TEXT_BOX_LS
CTRL_STRING_LS
CTRL_TEXT_MSG
CTRL_MENU_RING_LS
CTRL_PICTURE_RING_LS
CTRL_SQUARE_LED_LS
CTRL_SMOOTH_VERTICAL_BOX_LS
CTRL_SMOOTH_HORIZONTAL_BOX_LS
CTRL_ROUND_LED_LS
CTRL_TABS
CTRL_VERTICAL_SPLITTER_LS
CTRL_HORIZONTAL_SPLITTER_LS
CTRL_RAISED_BOX_LS
CTRL_CHECK_BOX
CTRL_CANVAS
CTRL_LIST_LS
CTRL_PICTURE_LS
CTRL_ROUND_RADIO_BUTTON
CTRL_RING_LS