WinUI 3 c++/winrt. The DataTemplate is listed at the top of the page:
<Page.Resources>
<DataTemplate x:Key="SomeViewTemplate" x:DataType="local:SomeModel">
<StackPanel>
<TextBlock Text="{x:Bind val1}"/>
<RatingControl MaxRating="{x:Bind val2}" />
</StackPanel>
</DataTemplate>
</Page.Resources>
Everything works fine on this page. How can I make this DataTemplate usable on other pages? In what place (file) should it be placed?


Let's say you have your
DataTemplatein a ResourceDictionary "DataTemplates.xaml". Note that you need to useBindinginstead ofx:Bind.Add it to App.xaml,
Then you should be able to use it.