Skip to content
Discussion options

You must be logged in to vote

From memory, ContentPresenter is meant to be used in control templates only, not data templates. The WPF docs explain this (and as far as I am aware the same applies to Avalonia):

You typically use the ContentPresenter in the ControlTemplate of a ContentControl to specify where the content is to be added. Every ContentControl type has a ContentPresenter in its default ControlTemplate.

When a ContentPresenter object is in a ControlTemplate of a ContentControl, the Content, ContentTemplate, and ContentTemplateSelector properties get their values from the properties of the same names of the ContentControl. You can have the ContentPresenter property get the values of these properties from ot…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@timunie
Comment options

timunie Aug 22, 2025
Collaborator

Answer selected by Dyikot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants