Reputation: 4786
Imagine I have this brush:
<SolidColorBrush x:Key="MySolidDarkBackground" Color="{DynamicResource DarkBackgroundColorTop}" />
How can I use this brush for a scrollviewer background but with a different opacity?
<ScrollViewer VerticalScrollBarVisibility="Auto" Grid.Row="1">
<ScrollViewer.Background>
< ??? >
</ScrollViewer.Background>
</ScrollViewer>
Upvotes: 1
Views: 234
Reputation: 4578
You'd either have to create a second Brush resource and use it:
<SolidColorBrush x:Key="MyTransparentDarkBackground" Opacity="0.5" Color="{DynamicResource DarkBackgroundColorTop}" />
<ScrollViewer Background="{DynamicResource MyTransparentDarkBackground}" />
Or you could just reuse the dynamic Color resource:
<ScrollViewer>
<ScrollViewer.Background>
<SolidColorBrush Opacity="0.5" Color="{DynamicResource DarkBackgroundColorTop}" />
</ScrollViewer.Background>
</ScrollViewer>
Upvotes: 1