2011-04-20 1 views
5

ProgressValue를 통해 진행할 때 사용 가능한 열거 형 상태를 통해 ProgressState를 업데이트하는 WPF 예제가 있습니까?Win 7 작업 표시 줄의 진행률 표시 줄에 WPF의 TaskBarItemInfo 사용

I가 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는 0에서 당신은, 당신은 또한 ProgressState을 결합 할 수있는 ProgressValue 결합하는 것과 같은 방법으로 1

+0

ProgressValue에 대해 알고 있습니다. ProgressState에 대한 질문이었습니다. –

2

이중 사용하는 값입니다. 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, 
} 

은 내가 '매끄러운'방법이 일을 생각 이미 언급 한 방법으로, 변환기 또는 수동으로