2011-04-20 10 views
5

ProgressValueを進めるときに、利用可能な列挙状態を使ってProgressStateを更新するWPFの例はありますか?Win 7タスクバーの進行状況バーのWPFでTaskBarItemInfoを使用

私は私の進行状況値が0から1に実行するように結合し、次のコードがあります。

<Window.TaskbarItemInfo> 
    <TaskbarItemInfo Description="An app with a taskbar info description" 
        ProgressValue="{Binding Count}" ProgressState="Normal"/> 
</Window.TaskbarItemInfo> 

をしかし、ノーマルになしなしから行くには良い方法は何ですかその他のフロー:なし - 正常停止 - 正常 - なし。 上のコードは、0%の左のプログレスバーを示し、100%(1)で終了します。 私はViewModelを掛けている別のプロパティにコンバーターでこれをバインドすることができますが、誰かがより滑らかなソリューションを持っているかどうかを見たいと思っていました。

ありがとうございます!

+0

明確にするために、私のビューモデルは、0から1までの範囲で増加しているのいずれかであるだけ罰金(0.1)。しかし、スニペットのようにXAML ProgressStateをNormalに設定するのはあまりにも静的です。説明したように状態を循環させる必要があります。 –

答えて

3

ProgressValueあなたはProgressValueを結合されているのと同じように0から1

+0

私はProgressValueを知っています。質問はProgressStateに関するものでした。 –

2

二重 使用価値である、あなたも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, 
} 

は、私が「slickest」の方法がこれを行うに考えるあなたは既に述べた通り、コンバータとするか、手動で

関連する問題