mcintyre321 / FormFactory

MVC5, Core or standalone - Generate rich HTML5 forms from your ViewModels, or build them programatically
http://formfactoryaspmvc.azurewebsites.net/
MIT License
304 stars 102 forks source link

Create button inside PropertyVM #70

Closed ivansoriabia closed 5 years ago

ivansoriabia commented 5 years ago

Hello!

How I can do to create a button in an PropertyVM. I have tried the answer that Harry posted in this issue but I have no idea about how to create a button in XElement.

Please how I can make a button inside a PropertyVM, using XElement (or not using it if it's not done with XElement)?

Thanks a lot.

mcintyre321 commented 5 years ago

I think you should be able to do this:

    new PropertyVm(typeof(XElement), "number")
    {
        DisplayName = "A button",       
        Value = XElement.Parse("<button name='foo' />"), //or whatever html you want there
    }
ivansoriabia commented 5 years ago

Thank You!

I have done it like you have said and it's working as expected, so I will close this issue.