Demo suggestion
hashitha opened this issue ยท 6 comments
Something similar can be done, though for this library we would have to display the class or xml that creates that form instead of XAML.
Crazy idea: walk the built form definition and generate code from the fields/resources. This would allow generating code from the form.
@edongashi you mean using this?
Writing xaml would not be possible unless we embed a small runtime for features like validation/bindings.
What I was thinking was something like this:
You have a form with 2 rows, first row contains a StringField with a Name that is an IValueProvider of PropertyBinding(Name="MyName")
The other row may contain an ActionElement with a label IValueProvider of LiteralValue("LOGIN")
From these facts I can derive that we have a form with a string and an action, more exactly:
[Action("something", "LOGIN")]
class Form
{
[Field(Name = "{Binding MyName}")]
public string Something { get; set; }
}
I have another idea which is much easier, anyone knows how to display highlighted c# source code?
I think https://github.com/icsharpcode/AvalonEdit may have some re-usable components. How does MD in xaml demo handle this?