예제 #1
0
 void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
 {
     switch (connectionId)
     {
     case 1:
         this.myShowNumberCtrl = ((CustomDepPropApp.ShowNumberControl)(target));
         return;
     }
     this._contentLoaded = true;
 }
        private static void CurrentNumberChanged(DependencyObject depobj, DependencyPropertyChangedEventArgs args)
        {
            //Cast the DependencyObject into ShowNumberControl
            ShowNumberControl c = (ShowNumberControl)depobj;

            //Get the Label control in the ShowNumberControl
            Label theLabel = c.numberDisplay;

            //Set the Label with the new value
            theLabel.Content = args.NewValue.ToString();
        }