示例#1
0
        /// <summary>
        /// Called when the Framework OnApplyTemplate is called. Inheritors should override this method should they have some custom template-related logic.
        /// This is done to ensure that the <see cref="P:IsTemplateApplied"/> property is properly initialized.
        /// </summary>
        protected override bool ApplyTemplateCore()
        {
            var applied = base.ApplyTemplateCore();

            if (this.leftArrowPresenter != null)
            {
                this.leftArrowPresenter.Click -= this.OnLeftArrowPressed;
            }
            if (this.rightArrowPresenter != null)
            {
                this.rightArrowPresenter.Click -= this.OnRightArrowPressed;
            }

            this.layoutRoot = this.GetTemplatePartField <Grid>(LayoutRootName);
            applied         = applied && this.layoutRoot != null;

            this.thumbnailList = this.GetTemplatePartField <PaginationListControl>(ThumbnailListName);
            applied            = applied && this.thumbnailList != null;

            this.thumbnailList.Attach(this);

            this.indexLabelControl = this.GetTemplatePartField <PaginationIndexLabelControl>(IndexLabelControlName);
            applied = applied && this.indexLabelControl != null;

            this.leftArrowPresenter = this.GetTemplatePartField <PaginationButton>(LeftArrowControlName);
            applied = applied && this.leftArrowPresenter != null;

            this.leftArrowPresenter.Click += this.OnLeftArrowPressed;

            this.rightArrowPresenter = this.GetTemplatePartField <PaginationButton>(RightArrowControlName);
            applied = applied && this.rightArrowPresenter != null;

            this.rightArrowPresenter.Click += this.OnRightArrowPressed;

            return(applied);
        }
 /// <summary>
 /// Initializes a new instance of the PaginationListControlAutomationPeer class.
 /// </summary>
 /// <param name="owner">The PaginationListControl that is associated with this PaginationListControlAutomationPeer.</param>
 public PaginationListControlAutomationPeer(PaginationListControl owner)
     : base(owner)
 {
 }