진행률 표시 줄에 대해 INotifyPropertyChanged를 구현하는 방법에 대한 자습서를 진행할 예정이며 다소 혼란 스럽다고 생각됩니다.WPF 용 INotifyPropertyChanged를 구현하는 방법 ProgressBar
이 내 XAML 코드 조각입니다 :
<ProgressBar Name="progressBar" Height="24" IsIndeterminate="{Binding IsIndeterminate}" Minimum="{Binding Minimum}" Maximum="{Binding Maximum}" Value="{Binding ProgressValue}"/>
이 내입니다 코드 숨김 니펫을 내 ProgressBar를 업데이트됩니다 있도록 내가 설정 내가 매번에서 INotifyPropertyChanged를 구현하려면 어떻게
public partial class MainWindow : System.Windows.Window {
public bool IsInderteminate { get; set; }
public double Minimum { get; set; }
public double Maximum { get; set; }
public double ProgressValue { get; set; }
public MainWindow() {
InitializeComponent();
this.progressBar.DataContext = this;
this.IsInderteminate = false;
}
private void btnLoadPremiumDetail_Click(object sender, RoutedEventArgs e) {
this.IsInderteminate = true;
// I do my work here
this.IsInderteminate = false;
}
private void _ValidateProcurementDetail() {
for (int i = 0; i < rowCount; i++) {
this.ProgressValue += 1;
//I do work here
}
}
}
ProgressValue 또는 IsIndeterminate? 여기
을 어느 당신은 문제가있는 부분입니까? 인터페이스 구현? 이벤트 일어나기? 또는 무엇을? [this] (http://msdn.microsoft.com/en-us/library/ms743695%28v=vs.110%29.aspx)를 확인 했습니까? –