I have an Xml file which tells me the controls that I have to add to a form but this Xml changes dynamically and I need to update the form.
Currently, I can read the XML file, but I dont know if it is possible to automatically create forms based on that or not ?
I have an Xml file which tells me the controls that I have to
Share
Yes It is possible.
WPF offers several ways of creating controls either in Xaml or in code.
For your case if you need to dynamically create your controls, you’ll have to create them in code. You can either create your control directly using their constructors as in:
Or you could create your controls as a string containing xaml and use a XamlReader to parse the string and create the desired control:
Now for which one of the two methods you want to use really depends on you.
Jean-Louis