Bind Stroke Thickness to Slider

image_pdfimage_print


   
   

<StackPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">


    <Polyline Margin="0.5in, 1.5in, 0, 0" 
              Points="0 0, 500 25, 0 50"
              VerticalAlignment="Center"
              Stroke="Blue"
              StrokeThickness="{Binding ElementName=sliderThickness,Path=Value }"
    />
    <Label Content="_Thickness" />
    <Slider Name="sliderThickness"
                    Minimum="0"
                    Maximum="100"
                    Value="24" />

</StackPanel>