Skip to content

Commit

Permalink
Merge pull request #592 from FishEagle/main
Browse files Browse the repository at this point in the history
Fix class name referenced in code snippet
  • Loading branch information
MikeCodesDotNET authored Jan 2, 2025
2 parents 01ca898 + bc06e49 commit fe08c75
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/get-started/wpf/datatemplates.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ In Avalonia UI, data templates are not stored in the application resources. (The

Instead, data templates are placed either inside a `DataTemplates` collection in a control, or inside the (and on `Application`):

For example, this code adds a data template to display the view model class `MyViewModel`:
For example, this code adds a data template to display the view model class `FooViewModel`:

```xml
<UserControl xmlns:viewmodels="using:MyApp.ViewModels"
Expand All @@ -34,4 +34,4 @@ Data templates in Avalonia can also target interfaces and derived classes (which

In WPF you can create a `DataTemplateSelector` to select or create a `DataTemplate` based on the provided data. In Avalonia you cannot do this; but you can implement `IDataTemplate` which can be seen as a good replacement for the `DataTemplateSelector`. Please find a sample [here](https://github.com/AvaloniaUI/Avalonia.Samples/tree/main/src/Avalonia.Samples/DataTemplates/IDataTemplateSample).

<XpfAd/>
<XpfAd/>

0 comments on commit fe08c75

Please sign in to comment.