Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3956698
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:23:48+00:00 2026-05-20T02:23:48+00:00

I have an Xml file which tells me the controls that I have to

  • 0

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 ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T02:23:49+00:00Added an answer on May 20, 2026 at 2:23 am

    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:

            // Create a button.
            Button myButton= new Button();
            // Set properties.
            myButton.Content = "Click Me!";
    
            // Add created button to a previously created container.
            myStackPanel.Children.Add(myButton);
    

    Or you could create your controls as a string containing xaml and use a XamlReader to parse the string and create the desired control:

            // Create a stringBuilder
            StringBuilder sb = new StringBuilder();
    
            // use xaml to declare a button as string containing xaml
            sb.Append(@"<Button xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
                                xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml' ");
            sb.Append(@"Content='Click Me!' />");
    
            // Create a button using a XamlReader
            Button myButton = (Button)XamlReader.Parse(sb.ToString());
    
            // Add created button to previously created container.
            stackPanel.Children.Add(myButton);
    

    Now for which one of the two methods you want to use really depends on you.

    Jean-Louis

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a site that loads in a XML file which tells where to
I have a xml file which I need to open with Microsoft Word 2007.
I have this xml file which has text init. i.e Hi my name is
I have an XML file which I need to parse using PHP and send
Im using c# .net , windows form application. I have a XML file which
I have an XML file which XML parser choke on. A part of it
I have an XML file which has many section like the one below: <Operations>
I have an XML file which I'd like to parse into a non-XML (text)
I have an XML file which has to be transformed using XSLT, I am
I have written xml file which contains html tags as element like <component> <input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.