Progressbar with control template and its MouseDown event wpf
- by Geetha
Hi All,
I am using a progress bar for the media element. i want to trigger Mousedown event for progress bar. Thai event is getting triggered only if i click on the border not in the middle(rectangle area to fill color)
Code:
<ControlTemplate x:Key="ratingBarTemplate" TargetType="{x:Type ProgressBar}">
<Border Name="PART_Track" Width="{TemplateBinding Width}" BorderBrush="Red" BorderThickness="2" >
<Rectangle Name="PART_Indicator" Fill="Green" Height="{TemplateBinding Height}" FlowDirection="LeftToRight" HorizontalAlignment="Left"/>
</Border>
</ControlTemplate>
<ProgressBar Name="probar" Minimum="0" Height="10" MouseDown="probar_MouseDown" BorderThickness="1" Template="{StaticResource ratingBarTemplate}" FlowDirection="LeftToRight"></ProgressBar>
Geetha.