我发现用来表示在进度条和轮然而使用进度相当多的例子;我能找到的只有一个JavaScript的例子来说明一个省略号(点 - 点 - 点)指的进步,因此我觉得问这个问题的。我的应用程序是不是很复杂 - 它只有几个检查框和一个按钮。最近我的团队要求提供的增强,并希望保持它很简单。
I found quite a few examples for showing progress where the progress bars and wheels are used however; I could find only one javascript example to show an ellipsis (dot-dot-dot) to refer progress hence I thought of asking this question. My app is not very complex - it only has a few check-boxes and one button. Recently my team requested for an enhancement and want to keep it simple as well.
有一个名为GO用户配置所需的设置后,点击按钮。其背后的code也确实简单 - 它的单击事件后关闭按钮,呼叫是使用一个独立的EXE 的ProcessStartInfo 执行三项行动reconcle,岗位和发布。我用的是 WaitForExist()的方法来重新启用按钮。
There is a button named 'GO' that the user clicks after configuring the required settings. The code behind it is also really straightforward - it disables the button after the click event and call's a standalone exe using ProcessStartInfo that performs three actions 'reconcle', 'post' and 'publish'. I use the WaitForExist() method to re-enable the button.
我的要求我的团队,以显示在按钮上的当前进程。他们只是想在按钮上的文字显示调和。核对..核对...(定期说,1秒),随后以类似的方式发布和出版
I was requested by my team to show the 'current process' on the button. They simply want the button text to show Reconciling. Reconciling.. Reconciling... (at regular intervals say, 1 sec) followed by Posting and Publishing in a similar fashion.
这将是很好知道最合适的方式来实现这一目标。先谢谢了。
It would be nice to know the most appropriate way to achieve this. Thanks in advance.
推荐答案这样做的最简单的方法是使用 ObjectAnimationUsingKeyFrames 。设置TargetProperty上的内容,并设置每个 DiscreteObjectKeyFrame 的值到调和。调和调和... ... 。
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....
例如用于控件模板与内容presenter 名为 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>更多推荐
在WPF按钮显示点
发布评论