-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support nested types in DataTemplate.DataType #2725
Comments
Slightly changed code: <ItemsControl Items="{Binding Items}">
<ItemsControl.ItemTemplate>
<DataTemplate DataType="{x:Type local:SomeClass+Data}">
<TextBlock Text="{Binding Value}" />
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl> is works in 0.8 but doesn't for latest version (0.8.999-cibuild0003188-beta). |
Any updates? |
Any news? :-) |
+1, it prevents from using CompiledBindings in few places :( |
Investigating this now, looks like this works fine in unit tests, which makes it harder to fix... Update: yep, seems to be our Mono.Cecil backend that's not handling this correctly. |
Including a repro (`EnumToEnumerable`) from a customer. Looks like the problem can't be reproduced in unit tests.
Using 11.0.4 I've auto completion for the + syntax, but getting a compile error that the type can't be found. Still not solved? |
@yankun issue is open and milestone is 11.x, so guess, no it's not available yet and doesn't have high priority seems like. |
I have written a replacement https://gist.github.com/nuc134r/a28efe6363ac5228df7d12d97af03f8d Just remove the Didn't look into |
@nuc134r if you have an idea how to properly support this, consider to file a PR instead of relying on a workaround. Community support is appreciated as far as I can tell. |
It looks like PRs which seem to exactly (and properly) fix the issue are already filed |
@nuc134r keep in mind, that this workaround will use reflection, and these static members might be trimmed out from the assembly if they are not used compile time. |
Just to make sure, is the current state of things in Avalonia that you cannot use a nested class to set DataType explicitly? |
I'm using Avalonia 11.2.3 but this is still not working. Any idea when the fix going to be published? |
if 11.2 doesn't have it, please try nightly, In this case should be shipped with 11.3 |
Currently TypeResolver goes crazy - raises exception (for 0.8.x version [clarification: only for F# modules that don't have namespace]) and gives error in compile time from the master branch.
Just to show some sample. This kind of code is perfectly valid in WPF:
While this is a rare use-case for C# in F# world it's common. Instead (or additional to) of using namespace, types are grouped in modules, like this:
So I think it would be very nice to have support for this scenario.
The text was updated successfully, but these errors were encountered: