/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); } }
/// <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(); }
/// <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(); }
/// <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); } }
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; }
/// <summary> /// Constructor. /// </summary> /// <param name="panel">Parent panel.</param> public PageCollection(PanoramaPanel panel) : base(panel, panel) { parent = panel; }