SetParentPage() private static méthode

Sets the parent page of the specified dependency object.
private static SetParentPage ( DependencyObject obj, PhoneApplicationPage value ) : void
obj System.Windows.DependencyObject The depedency object.
value PhoneApplicationPage The page.
Résultat void
 /// <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);
            }
        }