예제 #1
0
 public override void OnApplyTemplate()
 {
     base.OnApplyTemplate();
     this.part_Popup = this.GetTemplateChild("PART_Popup") as Popup;
     if (this.part_Popup == null)
     {
         throw new NullReferenceException("'{0}' template part is not found on 'PopupToggle' control " + ((object)"PART_Popup"));
     }
     PopupToggle.SetPopupPlacement(this.part_Popup, this.PopupPlacment);
 }
예제 #2
0
        private static void OnPopupPlacementChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs dependencyPropertyChangedEventArgs)
        {
            PopupToggle popupToggle = dependencyObject as PopupToggle;
            Popup       partPopup   = popupToggle.part_Popup;

            if (partPopup == null)
            {
                return;
            }
            PopupToggle.SetPopupPlacement(partPopup, popupToggle.PopupPlacment);
        }