protected override bool OnBubbleEvent(object source, EventArgs e) { bool result = false; CommandEventArgs ce = e as CommandEventArgs; if (ce != null) { if (ce.CommandName.Equals("Page")) { PageDirection direction; if (ce.CommandArgument.Equals("Right")) { direction = PageDirection.Right; } else { direction = PageDirection.Left; } PageCommandEventArgs pce = new PageCommandEventArgs(direction); OnPageCommand(pce); result = true; } } return(result); }
protected virtual void OnPageCommand(PageCommandEventArgs pce) { PageCommandEventHandler pageCommandEventDelegate = (PageCommandEventHandler)Events[PageCommandKey]; if (pageCommandEventDelegate != null) { pageCommandEventDelegate(this, pce); } }