fsprojects / FsXaml

F# Tools for working with XAML Projects
http://fsprojects.github.io/FsXaml/
MIT License
171 stars 48 forks source link

Generated type has an extra constructor that takes FrameworkElement as a parameter #27

Closed mkb137 closed 8 years ago

mkb137 commented 9 years ago

Let's say I have type MyUserControl = XAML<"MyUserControl.xaml",true> UserControl has one constructor that takes no parameters. The new type, MyUserControl, will only have one visible constructor as far as Intellisense is concerned, but if you go through the type's ConstructorInfo, you will find another constructor that takes a single FrameworkElement as a parameter. Creating the element with this second constructor will cause the control to fail to render properly. I happened to find this issue because I was creating the control using Unity's resolve. It used the second constructor by default and the control failed to render.

ReedCopsey commented 8 years ago

@mkb137 I believe this is fixed in the 2.0 projects. Please see #33

(Note that this version also has significant improvements throughout FsXaml...)