public bool SetPageIndex(int index) { if (index < 0) { index = 0; } if (index >= Pages) { index = Pages - 1; } lblPage.Text = (index + 1).ToString(); if (PageIndex == index) { return(false); } PageIndex = index; PageIndexChanged?.Invoke(this, EventArgs.Empty); return(true); }
protected virtual void OnPageIndexChanged() { PageIndexChanged.Invoke(this, EventArgs.Empty); }