Пример #1
0
        /// <summary>
        /// Provides derived classes an opportunity to handle changes to the PivotHeader property.
        /// </summary>
        /// <param name="oldPivotHeader">Old Value</param>
        /// <param name="newPivotHeader">New Value</param>
        protected void OnPivotHeaderChanged(FrameworkElement oldPivotHeader, FrameworkElement newPivotHeader)
        {
            if (parent != null)
            {
                parent.UpdatePivotItemHeader(this);
            }
            IPivotHeader header = newPivotHeader as IPivotHeader;

            if (header != null)
            {
                header.SetActive(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Initializes the PivotItem
        /// </summary>
        public void Initialize()
        {
            // Set the header as inactive
            if (PivotHeader != null)
            {
                IPivotHeader header = PivotHeader as IPivotHeader;
                if (header != null)
                {
                    header.SetActive(false);
                }
            }

            // Make the PivotContent invisible
            if (PivotContent != null)
            {
                ((FrameworkElement)PivotContent).Visibility = Visibility.Collapsed;
            }
        }
Пример #3
0
        /// <summary>
        /// Activates/Deactivates the Pivot Header and Pivot Content
        /// based on the 'isActive' flag.
        /// </summary>
        /// <param name="isActive">Flag to indicate whether the Pivot Header and Pivot Content should be Activated or Decativated</param>
        public void SetActive(bool isActive)
        {
            if (PivotHeader != null)
            {
                IPivotHeader header = PivotHeader as IPivotHeader;
                if (header != null)
                {
                    header.SetActive(isActive);
                }
            }

            if (PivotContent != null)
            {
                IPivotContent content = PivotContent as IPivotContent;
                if (content != null)
                {
                    content.SetActive(isActive);
                }
                else
                {
                    PivotContent.Visibility = isActive ? Visibility.Visible : Visibility.Collapsed;
                }
            }
        }