Adding Image/Button Click Event Handler Dynamically in C# Silverlight
<p>Please check the following:</p>

<pre><code>/// &lt;summary&gt;
/// This method returns a custom column control for the AgDataGrid from devex with a   button design including button click event handlers
/// &lt;/summary&gt;
/// &lt;param name="headerContent"&gt;The header column value for this cell&lt;/param&gt;
/// &lt;param name="control"&gt;The DataTemplate XAML needed to Load the control&lt;/param&gt;
/// &lt;param name="routedEventHandler"&gt;The Button Click Event&lt;/param&gt;
/// &lt;returns&gt;AgDataGridColumn&lt;/returns&gt;
public AgDataGridColumn CustomColumn(string headerContent, string control, RoutedEventHandler routedEventHandler)
{
AgDataGridColumn _AgDataGridColumn = new AgDataGridColumn();
_AgDataGridColumn.HeaderContent = headerContent;
_AgDataGridColumn.CellDisplayTemplate = XamlReader.Load(control) as DataTemplate;
_AgDataGridColumn.AllowSorting = DefaultBoolean.False;
_AgDataGridColumn.PrepareCellDisplayElement += (d, _e) =&gt;
{
    ((Button)_e.DisplayElement).Click -= routedEventHandler;
    ((Button)_e.DisplayElement).Click += routedEventHandler;
};
return (_AgDataGridColumn);
}
</code></pre>

<p>I would like to convert this method to the silverlight datagrid. I am trying to find a proper way of doing the PrepareCellDisplayElement line, adding the event handlers. That method does not seem to exist for sl datagrid. Any help would be appreciated.</p>
