How can I use an F# type with generics in Silverlight 4 and XAML? -
take f# following code:
type blah<'t>(objects : 't array) = // whatever
when try use type in xaml document, there no type associated generic parameter, , it's ugly. think compiler complains, too:
<ns:blah foo="bar"/>
so, try alias type (at bottom of blah.fs file):
type stuffblah = blah<stuff>
then when use in same way in xaml document, type not found exist:
<ns:stuffblah foo="bar"/>
why that? there cleaner, more elegant way this? i'm still getting hang of silverlight, xaml, , f#, advice appreciated. thanks.
the reason stuffblah
version doesn't work particular piece of f# syntax creates type alias f# project vs. creating actual type. since name not visible @ il level actual type not accessible silverlight or xaml in general.
one way work around create stuffblah
first class type derives stuff<'t>
. not ideal @ work.
Comments
Post a Comment