May 11th, 2011, 06:28 PM
Dynamic Dialog using from XAML in .net desktop application
I am trying to rewrite a huge old MFC/C++ project using C# /WPF.
In this project we support scripting language something that we developed here in C/C++
The scripting(text files) allows the user to create a dialog with basic UI elements. Internally it creates a MFC Dialog.
How can I do this using WPF and XAML ?
It is simple to load a XAML Script that creates the dialog how ever say I want to carry out some processing using the values in the dialog.
How can I achieve that.
Say for instance I have a simple WPF application that loads a script. ( This is just an example)
Job of the script is to show a simple dialog box with 2 float numbers in text boxes.
Then I have 4 radio buttons that show the operation Add / Subtract / Multiply and Divide.
And a Calculate button. When user presses the calculate button It should show the result in a message box carrying out the right operation between the numbers.
All the above should be done through only script.
And a OK button that closes the dialog, however when he closes the dialog I want to retain values from the dialog into some sort of Data Structure.
Any help in this regard is greatly Appreciated.
Thanks a bunch in Advance.
May 23rd, 2011, 05:55 PM
Re: Dynamic Dialog using from XAML in .net desktop application
How did you do the dynamic UI in MFC? I imagine, you parsed the script, and turned the script items into MFC controls, right?
Well, you would do the same for WPF - just parse the script and turn the script items into WPF controls.
P.S. This is exactly what a xaml file is (perhaps it might be easier to translate your script file into a xaml file and then load the xaml file?).
Click Here to Expand Forum to Full Width