question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Api request: DataTemplateInclude

See original GitHub issue

Discussed 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 like vm:TestItem.
  • DataTemplates property is readonly.
  • DataTemplates can not merge each other like ResourceDictionary or Styles.

So is there any way to share DataTemplates across projects?</div>

The simplest way seems implements a DataTemplateInclude like StyleInclude.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:4
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
yll690commented, Jan 15, 2023

I have a new idea. How about adding a DataTemplates property to Styles? Avalonia can also search every Styles.DataTemplates like searching Application.DataTemplates and Controls.DataTemplates. Then we can use StyleInclude instead of DataTemplateInclude and the DataTemplate can apply to models automatically, too.

0reactions
trommlbommlcommented, Jul 7, 2022

Is there any huge drawback of having this?

Resources > ResourceInclude Styles > StyleInclude DataTemplates > ?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found