I'm trying to reuse a datatemplate defined in the window's resources but I receive "The resource ToolBarButtons could not be resolved" error.
The datatemplate, where I'm trying to bind to is (some code replaced with ...):
And the control that I want to bind:
What is the problem here?
The datatemplate, where I'm trying to bind to is (some code replaced with ...):
VB.NET:
<Window.Resources>
<DataTemplate x:Key="ToolBarButtons">
<Border Margin="2" Padding="2" BorderBrush="#FF1A1616" BorderThickness="2" CornerRadius="5" Background="#FF8D7E7E">
<DockPanel>
<Button Name="NewGrid2" Style="{DynamicResource NoChromeButtonStyle}" Click="NewGrid_Click" >
<Image ..."></Image>
</Button>
</DockPanel>
</Border>
</DataTemplate>
</Window.Resources>
And the control that I want to bind:
VB.NET:
<ContentControl ContentTemplate="{StaticResource ToolbarButtons}"></ContentControl>
What is the problem here?