示例#1
0
        /// <summary>
        /// Called when [selected pivot item changed].
        /// </summary>
        /// <param name="d">The d.</param>
        /// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
        public static void OnSelectedPivotItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //  Get the pivot control and pivot item.
            PivotControl me   = d as PivotControl;
            PivotItem    item = e.NewValue as PivotItem;

            //  Continue only if we have non-null objects.
            if (me == null || item == null)
            {
                return;
            }

            me.PivotControl_SizeChanged(me, null);
            me.UpdatePositioning(e.OldValue == null ? true : false);
        }
示例#2
0
        /// <summary>
        /// Selects the pivot item.
        /// </summary>
        /// <param name="pivotItem">The pivot item.</param>
        public void SelectPivotItem(object pivotItem)
        {
            //  Deselect all items.
            foreach (var pitem in PivotItems)
            {
                pitem.IsSelected = false;
            }

            PivotItem item = pivotItem as PivotItem;

            if (item != null)
            {
                item.IsSelected = true;
            }

            SelectedPivotItem = item;
        }
 private static void OnIsInitialPageChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
 {
     PivotItem me = o as PivotItem;
 }