How to generate WPF controls automatically based on XML file?

后端 未结 4 1654
没有蜡笔的小新
没有蜡笔的小新 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:29

    Adding controls through the Children.Add method is the quickest way i've found, such as for example

                this.Grid.Add(new TextBox() { Text = "Babau" });
    

提交回复
热议问题