GetIsSubscribed() private static method

Gets whether the specified dependency object is subscribed to the private manager or not.
private static GetIsSubscribed ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject The dependency object.
return bool
Ejemplo n.º 1
0
 /// <summary>
 /// Unsubscribes an element from the private manager.
 /// </summary>
 /// <param name="target">The framework element.</param>
 private static void UnsubscribeFrameworkElement(FrameworkElement target)
 {
     // If element is subscribed, unsubscribe.
     if (TurnstileFeatherEffect.GetIsSubscribed(target))
     {
         TurnstileFeatherEffect.SetParentPage(target, null);
         TurnstileFeatherEffect.SetIsSubscribed(target, false);
     }
 }
        /// <summary>
        /// Subscribes an element to the private managers.
        /// </summary>
        /// <param name="target">The framework element.</param>
        private static void SubscribeFrameworkElement(FrameworkElement target)
        {
            if (!TurnstileFeatherEffect.GetIsSubscribed(target))
            {
                // Find the parent page.
                PhoneApplicationPage page = target.GetParentByType <PhoneApplicationPage>();
                if (page == null)
                {
                    return;
                }

                TurnstileFeatherEffect.SetParentPage(target, page);
                TurnstileFeatherEffect.SetIsSubscribed(target, true);
            }
        }