Display dot-dot-dot progress in a WPF button
The simplest way of doing that is using an ObjectAnimationUsingKeyFrames
. Set the TargetProperty on the Content and set the Value
of each DiscreteObjectKeyFrame
to Reconciling. Reconciling.. Reconciling...
.
Example for a ControlTemplate
with a ContentPresenter
named PART_Content
:
<ControlTemplate.Triggers> <Trigger Property="IsEnabled" Value="False"> <Trigger.EnterActions> <BeginStoryboard> <Storyboard> <ObjectAnimationUsingKeyFrames Storyboard.TargetName="PART_Content" Storyboard.TargetProperty="Content" Duration="00:00:00.8" RepeatBehavior="Forever"> <DiscreteObjectKeyFrame KeyTime="00:00:00.0" Value="Loading"/> <DiscreteObjectKeyFrame KeyTime="00:00:00.2" Value="Loading."/> <DiscreteObjectKeyFrame KeyTime="00:00:00.4" Value="Loading.."/> <DiscreteObjectKeyFrame KeyTime="00:00:00.6" Value="Loading..."/> </ObjectAnimationUsingKeyFrames> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> </Trigger></ControlTemplate.Triggers>