コード例 #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;
 }
コード例 #2
0
        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();
        }