In F# I have code with structure like this:
module MyNS.MyModule
type SomeType =
member x.value = "some value"
Assemble with it code named MyNs
. I referenced to it from C# WPF application and do the same in XAML:
<UserControl x:Class="WpfTest"
xmlns:data="clr-namespace:MyNS;assembly=MyNs">
then I trying to used SomeType
in DataTemplate
:
<DataTemplate DataType="{x:Type data:MyModule.SomeType}">
But have an error about missing type.
I think it should look like below, with MyModule+SomeType
instead of MyModule.SomeType
for a nested class.
<UserControl x:Class="WpfTest"
xmlns:data="clr-namespace:MyNS;assembly=MyNs">
<DataTemplate DataType="{x:Type data:MyModule+SomeType}">
Found it here on SO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With