I'm quite new in WPF. My problem is I want to create a Grid with text in background. Below is my code. But I want to create a style to reuse in many windows. How can I create it in ResourceDictionary?
<Grid>
<ListBox Opacity="0.5" Width="100" Height="100"></ListBox>
<TextBlock Text="My text" Foreground="Black" Opacity="0.5" FontSize="50" FontWeight="Bold">
<TextBlock.LayoutTransform>
<RotateTransform Angle="-45"></RotateTransform>
</TextBlock.LayoutTransform>
</TextBlock>
<Grid.Background>
<SolidColorBrush Color="LightPink" Opacity="0.5"/>
</Grid.Background>
</Grid>
I tried to code some line:
<Style x:Key="myGridStyle" TargetType="{x:Type Grid}">
<Setter Property="Background" Value="LightPink"/>
<Setter Property="Opacity" Value="0.5"/>
<!--what i have to code here?-->
</Style>
Please help me to continue.
Thank you in advanced!