Click here to Skip to main content
15,868,014 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Guys,

We are looking to edit XAML forms at runtime. It facilitate users to add controls or change the place of the controls on form at run time as per his desire.

Is there anyway to do this?

Thanks in advance and appreciate your reply.

Regards,
Vikas

What I have tried:

Have google but didnt find appropriate solution on the same.
Posted
Comments
Richard MacCutchan 16-Jun-21 8:49am    
I do not think that will work, since the XAML is processed by the compiler and turned into MSIL code. There ways to do what you want by providing the code to create and design controls at runtime.
[no name] 16-Jun-21 14:41pm    
Even if users could create controls, the whole concept of binding and models would be lost on them. Users would need to become programmers.
Adérito Silva 31-Jul-21 17:03pm    
Do you mean, you want users to edit XAML files for application theming purposes? Your do you want them to be able to compile applications for themselves?
Adérito Silva 31-Jul-21 17:12pm    
For theming purposes, you would set up your own theme object (for instance, a class derived from ResourceDictionary). Then, users would download a theme template from your website, or something, and they would edit it and compile it as a DLL, using Visual Studio. Your application would then load that assembly (the theme DLL) and look for your own theme type on the DLL, instantiate it and add it to the application's merged resource dictionaries.

Users would need your theme template, with all XAML files and resources, so they could have a starting point and change only what they need. They would also need to use Visual Studio (it is free anyway), which can be overwhelming for non-developer users but has the advantage of having the XAML designer and everything else that's needed.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900