Anyway, here's an example:
public delegate void ChartSelected(int chartId);public ChartSelected onChartSelected = null;
So the parent control or page would assign a method to the onChartSelected delegate to be fired when, in this case, a chart is selected:
selector.onChartSelected = MyEventMethod;
And the method fired when called would look like the delegate identifier:
private void ChartSelected(int chartId){// do something}
Of course, the control declaring the delegate has to fire the event at some point:
if (onChartSelected != null)onChartSelected(someSelectedValue);
No comments:
Post a Comment