Ejemplo n.º 1
0
        /// <summary>
        ///     Handles changes to the ItemWidth property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnCellWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel fwPanel      = (PanoramaPanel)d;
            double        oldItemWidth = (double)e.OldValue;
            double        newItemWidth = fwPanel.CellWidth;

            fwPanel.OnCellWidthChanged(oldItemWidth, newItemWidth);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Handles changes to the ItemHeight property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnCellHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel fwPanel       = (PanoramaPanel)d;
            double        oldItemHeight = (double)e.OldValue;
            double        newItemHeight = fwPanel.CellHeight;

            fwPanel.OnCellHeightChanged(oldItemHeight, newItemHeight);
        }
Ejemplo n.º 3
0
        /// <summary>
        ///     Handles changes to the Orientation property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel panel          = (PanoramaPanel)d;
            Orientation   oldOrientation = (Orientation)e.OldValue;
            Orientation   newOrientation = panel.Orientation;

            panel.OnOrientationChanged(oldOrientation, newOrientation);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Handles changes to the DragOpacity property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnDragOpacityChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel panel          = (PanoramaPanel)d;
            double        oldDragOpacity = (double)e.OldValue;
            double        newDragOpacity = panel.DragOpacity;

            panel.OnDragOpacityChanged(oldDragOpacity, newDragOpacity);
        }
Ejemplo n.º 5
0
        /// <summary>
        ///     Handles changes to the Easing property.
        /// </summary>
        /// <param name="d"></param>
        /// <param name="e"></param>
        private static void OnEasingChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel panel = d as PanoramaPanel;

            if (panel != null)
            {
                panel.OnEasingChanged((EasingFunctionBase)e.OldValue, (EasingFunctionBase)e.NewValue);
            }
        }
Ejemplo n.º 6
0
        /// <summary>
        ///     Handles changes to the PageWidth property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnPageWidthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel fwPanel  = (PanoramaPanel)d;
            double        oldWidth = (double)e.OldValue;
            double        newWidth = fwPanel.PageWidth;

            fwPanel.OnPageWidthChanged(oldWidth, newWidth);
            fwPanel.InvalidateMeasure();
        }
Ejemplo n.º 7
0
        /// <summary>
        ///     Handles changes to the PageHeight property.
        /// </summary>
        /// <param name="d">LauncherPanel</param>
        /// <param name="e">DependencyProperty changed event arguments</param>
        private static void OnPageHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel fwPanel   = (PanoramaPanel)d;
            double        oldHeight = (double)e.OldValue;
            double        newHeight = fwPanel.CellHeight;

            fwPanel.OnCellHeightChanged(oldHeight, newHeight);
            fwPanel.InvalidateMeasure();
        }
Ejemplo n.º 8
0
        /// <summary>
        ///     Handles changes to the ActivePages property.
        /// </summary>
        /// <param name="o"></param>
        /// <param name="e"></param>
        private static void OnActivePageChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
        {
            PanoramaPanel panel = o as PanoramaPanel;

            if (panel != null)
            {
                panel.OnActivePageChanged((Int32)e.OldValue, (Int32)e.NewValue);
            }
        }
Ejemplo n.º 9
0
        private void Loaded(Object sender, EventArgs e)
        {
            // Get the parent PanoramaPanel
            panel = VisualTreeHelper.GetParent(AssociatedObject) as PanoramaPanel;

            // If there is no parent PanoramaPanel, disable this behavior
            if (panel == null)
            {
                return;
            }

            // Set up the delay scheduler
            scheduler = new DelayScheduler(AssociatedObject.Dispatcher);

            // Subscribe to related events
            AssociatedObject.PreviewMouseDown += PreviewMouseDown;
            AssociatedObject.PreviewMouseMove += PreviewMouseMove;
            AssociatedObject.PreviewMouseUp   += PreviewMouseUp;
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="panel">Parent panel.</param>
 public PageCollection(PanoramaPanel panel)
     : base(panel, panel)
 {
     parent = panel;
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="panel">Parent panel.</param>
 public PageCollection(PanoramaPanel panel)
     : base(panel, panel)
 {
     parent = panel;
 }