protected virtual void OnItemCommand(TemplatedListCommandEventArgs e) { TemplatedListCommandEventHandler onItemCommandHandler = (TemplatedListCommandEventHandler)Events[EventItemCommand]; if (onItemCommandHandler != null) { onItemCommandHandler(this, e); } }
protected override bool OnBubbleEvent(object source, EventArgs e) { if (e is CommandEventArgs) { // Add the information about Item to CommandEvent. TemplatedListCommandEventArgs args = new TemplatedListCommandEventArgs(this, source, (CommandEventArgs)e); RaiseBubbleEvent(this, args); return(true); } return(false); }
protected override bool OnBubbleEvent(object source, EventArgs e) { // Handle events raised by children by overriding OnBubbleEvent. bool handled = false; if (e is TemplatedListCommandEventArgs) { TemplatedListCommandEventArgs ce = (TemplatedListCommandEventArgs)e; OnItemCommand(ce); handled = true; if (String.Compare(ce.CommandName, "Select", true) == 0) { SelectedIndex = ce.Item.ItemIndex; OnSelectedIndexChanged(EventArgs.Empty); } } return(handled); }