Support generic types in DataTemplate.DataType
See original GitHub issueE.g.:
<DataTemplate DataType="core:Library{core:ShapeStyle}">
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:17 (9 by maintainers)
Top Results From Across the Web
How to reference a generic type in the DataType attribute ...
No, you cannot express a generics type in XAML. You will have to create a concrete type that extends your generic one ....
Read more >DataTemplate with an object taking a generic
There's no direct support for hooking a DataTemplate to a generic type. However, the generally accepted way of working around this is to...
Read more >generic type in xaml - Microsoft Q&A
Hi <DataTemplate DataType="{x:Type vm:MyViewModel1}"> <StackPanel ... any help will be appreciated, thanks in advance.
Read more >Does Angular Support Generic Component Types?
We can't provide generic types to our template selectors so how does Angular support generic components? In this article we will explain how ......
Read more >Avalonia: Support for TypeName property on x:Type in xaml ...
Avalonia: Support for TypeName property on x:Type in xaml editor. When setting TypeName property on <x:Type /> I get error Cannot resolve symbol...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There’s no workaround for XAML currently, XAML in general doesn’t support generic types well, so I’m not entirely sure how to add this.
However, you should be able to add
DataTemplate
s with generic types from code, if that would help?For anyone trying to use generics (String, Double, Int, etc), here is what I did to get it working:
then in xaml just do this