Progressbar with control template and its MouseDown event wpf

Posted by Geetha on Stack Overflow See other posts from Stack Overflow or by Geetha
Published on 2010-06-01T06:50:05Z Indexed on 2010/06/01 6:53 UTC
Read the original article Hit count: 399

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about progressbar