Proposal: Add public APIs for creating FrameworkTemplate and derived types
See original GitHub issueProposal: Add public APIs for FrameworkTemplate and derived types
Some scenarios for libraries are complexified when trying to create FrameworkTemplate and derived types, having to use XamlReader
to create them.
Summary
Add the ability to create DataTemplate, ControlTemplate, and ItemsPanelTemplate types from code:
var dataTemplate = new DataTemplate(() => new TextBlock() { Text = "My text" });
var itemsPanelTemplate = new ItemsPanelTemplate(() => new StackPanel());
var controlTemplate = new ControlTemplate(typeof(ContentControl), () => new ContentPresenter());
Rationale
This will simplify the creation of Framework Templates and potentially improve performance by remove the parsing of literal XAML.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:39
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Using Proposed API
Proposed APIs are a set of unstable APIs that are implemented in VS Code but not exposed to the public as stable APIs...
Read more >Guide to building an enterprise API strategy
APIs enable enterprises to better deliver diverse data and services to internal and external customers, and open up new revenue streams.
Read more >Entity framework attributes. In the Choose Model Contents step
Entity framework attributes. In the Choose Model Contents step, choose the Generate from a database option and click the Next button (see Figure...
Read more >Public APIs Developers Can Use in Their Projects
Public APIs provide developers with access to existing functionality and data that they can use to create new applications.
Read more >Generating REST APIs from data classes in Python
This solution uses data classes to generate Open API service definitions with AWS extensions and to create API Gateway configurations.
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
PLEASE add this feature ASAP.
Would IElementFactory be used by ContentControl as well?
Otherwise pretty much back to square one,
Not being able to instantiate templates from C# is the main and almost only blocker to a C# first syntax.