void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.BdrOut = ((System.Windows.Controls.Border)(target)); return; case 2: this.spMain = ((System.Windows.Controls.StackPanel)(target)); return; case 3: this.txtHead = ((System.Windows.Controls.TextBlock)(target)); return; case 4: this.proMain = ((Anything.UserControls.ProgressBarEx)(target)); return; case 5: this.txtFoot = ((System.Windows.Controls.TextBlock)(target)); return; } this._contentLoaded = true; }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.Me = ((Anything.UserControls.ProgressBarEx)(target)); return; case 2: this.bdrOuter = ((System.Windows.Controls.Border)(target)); return; case 3: this.bdrInner = ((System.Windows.Controls.Border)(target)); return; } this._contentLoaded = true; }
private static void PropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) { ProgressBarEx pbe = (ProgressBarEx)sender; pbe.bdrInner.Width = (pbe.Value / pbe.Maximum) * (pbe.bdrOuter.ActualWidth - (pbe.bdrOuter.BorderThickness.Left + pbe.bdrOuter.BorderThickness.Right) - (pbe.bdrInner.Margin.Left + pbe.bdrInner.Margin.Right) - 1); }