将WPF中的TaskBarItemInfo用于Win 7任务栏中的进度栏​​

| 在通过ProgressValue进行进度时,是否有人有WPF示例通过可用的枚举状态更新ProgressState? 我有以下代码将我的进度值绑定为从0到1:
<Window.TaskbarItemInfo>
    <TaskbarItemInfo Description=\"An app with a taskbar info description\" 
                     ProgressValue=\"{Binding Count}\" ProgressState=\"Normal\"/>
</Window.TaskbarItemInfo>
但是,从“无”到“正常”到“无”或其他流的一种好方法是:无-正常-暂停-正常-无。 上面的代码在左侧显示进度条为0%,然后在100%处完成(1)。 我想我可以将它与转换器绑定到ViewModel的另一个属性上,但是我想看看是否有人有任何更好的解决方案。 谢谢!     
已邀请:
ProgressValue是double 使用0到1之间的值     
以与绑定ProgressValue相同的方式,还可以绑定ProgressState。 ProgressState的类型是一个称为TaskbarItemProgressState的枚举,其中包括您已经提到的状态。
public enum TaskbarItemProgressState
{
    // Summary:
    //     No progress indicator is displayed in the taskbar button.
    None = 0,
    //
    // Summary:
    //     A pulsing green indicator is displayed in the taskbar button.
    Indeterminate = 1,
    //
    // Summary:
    //     A green progress indicator is displayed in the taskbar button.
    Normal = 2,
    //
    // Summary:
    //     A red progress indicator is displayed in the taskbar button.
    Error = 3,
    //
    // Summary:
    //     A yellow progress indicator is displayed in the taskbar button.
    Paused = 4,
}
我认为最“聪明”的方法就是您已经提到的方法,无论是使用转换器还是手动     

要回复问题请先登录注册