Api request: DataTemplateInclude
See original GitHub issueDiscussed in https://github.com/AvaloniaUI/Avalonia/discussions/8426
<div type='discussions-op-text'>Originally posted by yll690 July 1, 2022
In WPF I can put the DataTemplates in ResourceDictionary and merge it in other application. But in Avalonia there are many limits:
DataTemplates can’t be put in ResourceDictionary without key. It’s also not work when has a key likevm:TestItem.DataTemplatesproperty is readonly.DataTemplatescan not merge each other likeResourceDictionaryorStyles.
So is there any way to share DataTemplates across projects?</div>
The simplest way seems implements a DataTemplateInclude like StyleInclude.
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Amazon API Gateway API request and response data ...
The method request data includes request parameters (path, query string, headers) and the body. The integration response data includes response parameters ( ...
Read more >API Gateway mapping template and access logging variable ...
Valid values include: DELETE , GET , HEAD , OPTIONS , PATCH , POST , and PUT . $context.identity.accountId. The AWS account ID...
Read more >REST request templates - BMC Documentation
Request templates are a companion model to requests that allow new requests to be created based on the structure and contents of an...
Read more >Create and Use Templates | REST API
Learn how to create and use templates in the DocuSign eSignature API. ... To add default tab data to a document within a...
Read more >Web API and Templates with Python requests and Jinja2
Before we begin, you need to have the following modules installed: requests (for connecting to the API); jinja2 (for adding data to our...
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 Free
Top 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

I have a new idea. How about adding a
DataTemplatesproperty toStyles? Avalonia can also search everyStyles.DataTemplateslike searchingApplication.DataTemplatesandControls.DataTemplates. Then we can useStyleIncludeinstead ofDataTemplateIncludeand theDataTemplatecan apply to models automatically, too.Yes, because you cannot use the very handy feature defining data templates automatically applied by DataType in separate files. You need to define them all in app.xaml or the corresponding window, which is not very useful. that would also remove the need to define a ViewLocator as from the default samples as you can stick with automatically loaded datatemplates by datatype.