SetIsSubscribed() 개인적인 정적인 메소드

Sets whether the specified dependency object is subscribed to the private managers or not.
private static SetIsSubscribed ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject The dependency object.
value bool The value.
리턴 void
예제 #1
0
 /// <summary>
 /// Unsubscribes an element from the private managers.
 /// </summary>
 /// <param name="target">The framework element.</param>
 private static void UnsubscribeFrameworkElement(FrameworkElement target)
 {
     // If element is subscribed, unsubscribe.
     if (SlideInEffect.GetIsSubscribed(target))
     {
         SlideInEffect.SetParentPivot(target, null);
         SlideInEffect.SetParentPivotItem(target, null);
         SlideInEffect.SetIsSubscribed(target, false);
     }
 }
예제 #2
0
        /// <summary>
        /// Subscribes an element to the private managers.
        /// </summary>
        /// <param name="target">The framework element.</param>
        private static void SubscribeFrameworkElement(FrameworkElement target)
        {
            if (!SlideInEffect.GetIsSubscribed(target))
            {
                // Find the parent Pivot and PivotItem.
                Pivot            pivot, pTemp;
                PivotItem        pivotItem, iTemp;
                DependencyObject parent = VisualTreeHelper.GetParent(target);

                pTemp     = null;
                pivotItem = iTemp = null;

                while ((pTemp == null) && (parent != null))
                {
                    pTemp = parent as Pivot;
                    iTemp = parent as PivotItem;

                    if (iTemp != null)
                    {
                        pivotItem = iTemp;
                    }

                    parent = VisualTreeHelper.GetParent(parent as DependencyObject);
                }

                if (parent == null || pivotItem == null)
                {
                    return;
                }
                else
                {
                    pivot = pTemp;
                }

                AttachTransform(target);
                SlideInEffect.SetParentPivot(target, pivot);
                SlideInEffect.SetParentPivotItem(target, pivotItem);
                SlideInEffect.SetIsSubscribed(target, true);
            }
        }