Skip to content

In-Depth explanation of how to assign a Type Property in xaml #5701

Answered by maxkatz6
Sarund9 asked this question in Q&A
Discussion options

You must be logged in to vote

You need to define namespace:

<TreeDataTemplate xmlns:namespace="using:MyAvaloniaApp"
                                DataType="namespace:IMyInterface">
          
</TreeDataTemplate>

Or WPF style:

<TreeDataTemplate xmlns:namespace="clr-namespace:MyAvaloniaApp;assembly=MyAssemblyName"
                                DataType="namespace:IMyInterface">
          
</TreeDataTemplate>

This "xmlns" part is usually set on the root element of xml/xaml file.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sarund9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants