Can I inherit the same style for a ControlTemplate in two different windows? I am new to wpf and am not sure how to do this or even if it is possible. For example, if I have in Window1.xaml:
<Window.Resources>
<ControlTemplate x:Key="myStyle" TargetType="Button">
...
</ControlTemplate>
</Window.Resources>
And in Window2.xaml I want to use it as follows:
<Grid>
<Grid.Resources>
<Style TargetType="Button" BasedOn="{StaticResource myStyle}">
...
</Style>
</Grid.Resources>
<Grid>
How to import a style from the first window?
source
share