wpf 进度条
Action<DependencyProperty, double> UpdateProgressbarValue = (dp, value) => pb.SetValue(dp, value); double myvalue = 0; pb.Minimum = 0; pb.Maximum = output.RoundPlanSequences.Count; pb.Value = 0; foreach (RoundPlanSequence seq in output.RoundPlanSequences) { myvalue += 1; pb.Dispatcher.Invoke(UpdateProgressbarValue, System.Windows.Threading.DispatcherPriority.Background, System.Windows.Controls.ProgressBar.ValueProperty, myvalue); tempDic.Add(int.Parse(seq.Attributes["ViewRow"].ToString()), seq); //----------------------从新修改部分 RoundPlanContentTO to = new RoundPlanContentTO(); to.Row = int.Parse(seq.Attributes["ViewRow"].ToString()); to.Column = 11; to.Name = seq.Name; //to.LabelContent = seq.Barcode; bb.Data = seq.Barcode; bb.encode(); to.LabelContent = CreateBarCodeByString(bb.EncodedData, bb.Data); //RoundPlanSequence.Children.Add(lb); _roundPlan.Contents.Add(to.Name, to); //-----------------------从新修改部分 }