/// <summary> /// Handles changes to the ItemsSource property. /// </summary> /// <param name="d">PivotPanel</param> /// <param name="e">DependencyProperty changed event arguments</param> private static void OnItemsSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PivotPanel panel = (PivotPanel)d; ObservableCollection <PivotItem> oldItemsSource = (ObservableCollection <PivotItem>)e.OldValue; ObservableCollection <PivotItem> newItemsSource = panel.ItemsSource; panel.OnItemsSourceChanged(oldItemsSource, newItemsSource); }
/// <summary> /// Handles changes to the ContentBackground property. /// </summary> /// <param name="d">PivotPanel</param> /// <param name="e">DependencyProperty changed event arguments</param> private static void OnContentBackgroundChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PivotPanel panel = (PivotPanel)d; Brush oldContentBackground = (Brush)e.OldValue; Brush newContentBackground = panel.ContentBackground; panel.OnContentBackgroundChanged(oldContentBackground, newContentBackground); }
/// <summary> /// Handles changes to the HeaderHeight property. /// </summary> /// <param name="d">PivotPanel</param> /// <param name="e">DependencyProperty changed event arguments</param> private static void OnHeaderHeightChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PivotPanel panel = (PivotPanel)d; GridLength oldHeaderHeight = (GridLength)e.OldValue; GridLength newHeaderHeight = panel.HeaderHeight; panel.OnHeaderHeightChanged(oldHeaderHeight, newHeaderHeight); }
/// <summary> /// Sets the parent PivotPanel of the Pivot Item /// </summary> /// <param name="panel">PivotPanel</param> public void SetParent(PivotPanel panel) { parent = panel; }