tags:

views:

29

answers:

1

Assuming one has this Resource:

<Window.Resources>
  <ImageBrush x:Key="MyImageBrush" Opacity="0.5"
             ImageSource="image1.png" Stretch="None" 
             AlignmentX="Center" AlignmentY="Center" />
</Window.Resources>

Then how would I get to the Opacity value of that resource? I've tried the following but it doesn't work.

<TextBlock Text="{Binding ElementName=MyImageBrush, Path=Opacity}" />
A: 
<TextBlock Text="{Binding Source={StaticResource MyImageBrush}, Path=Opacity}" />

HTH, Kent

Kent Boogaart