Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update datatemplates.md #147

Merged
merged 3 commits into from
Nov 25, 2023
Merged

Update datatemplates.md #147

merged 3 commits into from
Nov 25, 2023

Conversation

Philippe-Laval
Copy link
Contributor

Need to indicate the other datype or the code will not compile

Need to indicate the other datype or the code will not compile
@@ -22,7 +22,7 @@ For example, this code adds a data template to display the view model class `MyV
<!-- Assuming that DataContext.Foo is an object of type
MyApp.ViewModels.FooViewModel then a red border with a corner
radius of 8 containing a TextBox will be displayed here -->
<ContentControl Content="{Binding Foo}"/>
<ContentControl DataType="viewmodels:UserControl1ViewModel" Content="{Binding Foo}"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UserControl1ViewModel is not mentioned anywhere on this page, and is a bit confusing.
Also, it would make more sense to add DataType on the top-level element here - UserControl.

@maxkatz6 maxkatz6 merged commit 01ff8f3 into AvaloniaUI:main Nov 25, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants