protected virtual void OnItemCommand(AccordionCommandEventArgs args) { if (ItemCommand != null) { ItemCommand(this, args); } }
// Pass an AccordionCommandEventArgs whenever a CommandEvent is raised protected override bool OnBubbleEvent(object source, EventArgs args) { var commandArgs = args as CommandEventArgs; if(commandArgs != null) { var accordionArgs = new AccordionCommandEventArgs(this, commandArgs.CommandName, commandArgs.CommandArgument); RaiseBubbleEvent(this, accordionArgs); return true; } return false; }
/// <summary> /// Wrap the CommandArgs of an ItemCommand event with AccordionCommandEventArgs /// </summary> /// <param name="source">Source</param> /// <param name="args">EventArgs</param> /// <returns>Whether the event was handled</returns> protected override bool OnBubbleEvent(object source, EventArgs args) { bool handled = false; AccordionCommandEventArgs accordionArgs = args as AccordionCommandEventArgs; if (accordionArgs != null) { OnItemCommand(accordionArgs); handled = true; } return handled; }
/// <summary> /// Pass an AccordionCommandEventArgs whenever a CommandEvent is raised /// </summary> /// <param name="source">Source</param> /// <param name="args">EventArgs</param> /// <returns>If the event was handled</returns> protected override bool OnBubbleEvent(object source, EventArgs args) { CommandEventArgs commandArgs = args as CommandEventArgs; if (commandArgs != null) { AccordionCommandEventArgs accordionArgs = new AccordionCommandEventArgs(this, commandArgs.CommandName, commandArgs.CommandArgument); RaiseBubbleEvent(this, accordionArgs); return(true); } return(false); }
protected virtual void OnItemCommand(AccordionCommandEventArgs args) { if (ItemCommand != null) ItemCommand(this, args); }