Esempio n. 1
0
        /// <summary>
        /// Handles changes to the IsFlipped property.
        /// </summary>
        private static void OnIsFlippedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            FlipControl target       = (FlipControl)d;
            bool        oldIsFlipped = (bool)e.OldValue;
            bool        newIsFlipped = target.IsFlipped;

            target.OnIsFlippedChanged(oldIsFlipped, newIsFlipped);
        }
Esempio n. 2
0
        static void OnPanelContentChanged(object sender, DependencyPropertyChangedEventArgs args, bool front)
        {
            FlipControl control  = sender as FlipControl;
            Panel       oldPanel = args.OldValue as Panel;
            Panel       newPanel = args.NewValue as Panel;

            if ((control != null) && (oldPanel != null))
            {
                control.LayoutRoot.Children.Remove(oldPanel);
            }
            if ((control != null) && (newPanel != null))
            {
                if (front)
                {
                    control.LayoutRoot.Children.Add(newPanel);
                }
                else
                {
                    control.LayoutRoot.Children.Insert(0, newPanel);
                    newPanel.Visibility = Visibility.Collapsed;
                }
            }
        }