How to generate WPF controls automatically based on XML file?

后端 未结 4 1626
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 03:55

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 fil

4条回答
  •  眼角桃花
    2020-11-30 04:44

    You can easily add controls via code in wpf, you can follow this article. Another thing worth noting is that XAML is a form of XML so you can you save your XAML to an XML file, that way you wouldn't need to add controls in code, however it depends on the complexity of your application.

提交回复
热议问题