/// <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 PaginationButtonAutomationPeer class. /// </summary> /// <param name="owner">The PaginationButton that is associated with this PaginationButtonAutomationPeer.</param> public PaginationButtonAutomationPeer(PaginationButton owner) : base(owner) { }