Use Slider to control Drop Shadow

image_pdfimage_print


   
    
<Window x:Class="BitmapEffects.Window4"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Bitmap Effects" Height="538" Width="600"
  >
    <StackPanel>
        <Rectangle Height="50" Width="200" Fill="White" Stroke="Black">
            <Rectangle.BitmapEffect>
                <DropShadowBitmapEffect 
            ShadowDepth="{Binding Path=Value, ElementName=sliderDrop}" 
              />
            </Rectangle.BitmapEffect>
        </Rectangle>
        <Slider Minimum="0" Maximum="10" Name="sliderDrop" Value="14"/>
        <TextBox Text="{Binding ElementName=sliderDrop, Path=Value}"/>


    </StackPanel>
</Window>