-
The Basic DataTemplate Sample - Approach 3 (Place a UserControl inside a Data Template) is not working. Describe the bugWhen set in a project called "CustomDataTemplate", I have an error on the "view" statement of the MainWindow.axaml:
Sample affectedScreenshots |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@DBenS it works for me without any change. Did you run it from source code or from your own project? Does the sample compile and run without an error? Tip Make sure you have setup the xml-namespace at the root node. Note The editor needs to have a fresh build after adding a new View, otherwise it can't find it and then you get this error. |
Beta Was this translation helpful? Give feedback.
-
need a sample to continue |
Beta Was this translation helpful? Give feedback.
Now I see. You have a mistake in your namespace for some reason. Maybe due to added PersonView in the wrong location and moved into the correct folder afterwards. Namespaces don't cover that automatically.
In PersonView.axaml.cs
In PersonView.axaml
<UserControl xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" - x:Class="…