In my project (ABC), I have MainWindow.xaml where I have defined a toolbar for it and this toolbar is defined in project under Resource/Views/ApplicationToolbar.xmal as following:
I have referenced it in my MainWindow.xaml as xmlns:local="clr-namespace:ABC" and as soon as I run it I get an
error indicating View123 not found.
More information: (EDIT)
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ABC">
<StackPanel x:Key="View1">
<Button Margin="3" Content="Test1"></Button>
<Button Margin="3" Content="Test2"></Button>
</StackPanel>
</ResourceDictionary>
Now in MainWindow.xmal have:
<Window x:Class="ABC.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:ABC"
Title="MainWindow" Height="350" Width="525">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="10"/>
<RowDefinition Height="*"/>
<RowDefinition Height="10"/>
</Grid.RowDefinitions>
<!-- FOLLOWING LINE CAUSING ERROR-->
<ContentControl Name="Toolbar" Content="{StaticResource View1 }"></ContentControl>
</Grid>
</Window>
What am I missing?
Thanks, Amit