void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.text = ((System.Windows.Controls.TextBlock)(target)); return; case 2: this.stepBar = ((ZdfFlatUI.StepBar)(target)); return; case 3: this.stepBar1 = ((ZdfFlatUI.StepBar)(target)); return; case 4: #line 22 "..\..\..\UITest\UCTStepBarTest.xaml" ((ZdfFlatUI.FlatButton)(target)).Click += new System.Windows.RoutedEventHandler(this.FlatButton_Click1); #line default #line hidden return; case 5: #line 23 "..\..\..\UITest\UCTStepBarTest.xaml" ((ZdfFlatUI.FlatButton)(target)).Click += new System.Windows.RoutedEventHandler(this.FlatButton_Click); #line default #line hidden return; case 6: #line 24 "..\..\..\UITest\UCTStepBarTest.xaml" ((ZdfFlatUI.FlatButton)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_AddItem); #line default #line hidden return; case 7: #line 25 "..\..\..\UITest\UCTStepBarTest.xaml" ((ZdfFlatUI.FlatButton)(target)).Click += new System.Windows.RoutedEventHandler(this.btn_RemoveItem); #line default #line hidden return; } this._contentLoaded = true; }
private static object OnProgressCoerceValueCallback(DependencyObject d, object baseValue) { //不让Progress超出边界 StepBar stepBar = d as StepBar; int newValue = Convert.ToInt32(baseValue); if (newValue < 0) { return(0); } else if (newValue >= stepBar.Items.Count) { return(stepBar.Items.Count - 1); } return(newValue); }