Brian Kiarie Mwaniki
How to use a templated control in main window view?
Hi @Mekasu0124, when using a templated control that is defined as a
ResourceDictionary
you need to include the resource itself in the main window view, like so:
<Window>
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://LoudnessMeter.Views.TemplatedControls/LargeLabelControl.axaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Design.DataContext>
<vm:MainWindowViewModel/>
</Design.DataContext>
<Grid>
<Grid>
<StackPanel>
<controls:LargeLabelControl />
</StackPanel>
</Grid>
</Grid>
</Window>
I hope this helps4 replies