Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Edit:</strong></p> <p><a href="http://www.codeproject.com/KB/progress/ProgressODoom.aspx" rel="nofollow">This</a> article from codeproject.com has a working version of the "barber pole" progress bar. Search the article for "CandyCaneProgressPainter".</p> <p><strong>Previous answer:</strong></p> <p><a href="http://social.msdn.microsoft.com/Forums/eu/wpf/thread/8aee5dff-b0f8-4434-8e2e-f6e7b187f951" rel="nofollow">This</a> does almost exactly what you want. All you have to do to make it what you want is restrict the visibility of the rectangle to the percentage you want and change the height/width ratio.</p> <p>The keywords you want are "storyboard", "animate" and "trigger"</p> <p>Here is the xaml from the link with some comments from the link on making the animation smooth:</p> <pre><code> &lt;Rectangle x:Name="pole" Width="100" Height="20" Stroke="Black" StrokeThickness="1"&gt; &lt;Rectangle.Fill&gt; &lt;DrawingBrush TileMode="Tile" Stretch="None" Viewbox="0,0,1,1" Viewport="0,0,25,25" ViewportUnits="Absolute"&gt; &lt;DrawingBrush.RelativeTransform&gt; &lt;TranslateTransform X="0" Y="0" /&gt; &lt;/DrawingBrush.RelativeTransform&gt; &lt;DrawingBrush.Drawing&gt; &lt;GeometryDrawing Brush="Red" Geometry="M10,0 25,0 15,25 0,25 Z" /&gt; &lt;/DrawingBrush.Drawing&gt; &lt;/DrawingBrush&gt; &lt;/Rectangle.Fill&gt; &lt;Rectangle.Triggers&gt; &lt;EventTrigger RoutedEvent="FrameworkElement.Loaded"&gt; &lt;BeginStoryboard&gt; &lt;Storyboard&gt; &lt;DoubleAnimation Storyboard.TargetProperty="(Rectangle.Fill).(DrawingBrush.RelativeTransform).(TranslateTransform.X)" From="0" To=".25" RepeatBehavior="Forever" Duration="0:0:1" /&gt; &lt;/Storyboard&gt; &lt;/BeginStoryboard&gt; &lt;/EventTrigger&gt; &lt;/Rectangle.Triggers&gt; &lt;/Rectangle&gt; </code></pre> <blockquote> <p>I guess the jerking happens if you remove the "width" value, but if the value is put back it runs smooth. Weird.</p> <p>Yup, indeed it basically needed a few adjustments with the multiples of the number rules the width in this case the animation can be a .1 or a .05 if for instance you have a 5000 width.... now it work great!</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload