Adding event handler causes load time NullPointer

Jul 6, 2010 at 8:27 PM


I've defined a column in my grid as follows:


<tk:DataGridTemplateColumn Header="Inspect">
   <Button Click="OnPlayClick">
    <Image Height="15" Source="../Icons/play-icon.png" />


When the XAML is loaded, the following NullPointer is thrown:

C:\dd\WPF_1\src\wpf\src\ControlsPack\WPFToolkit\DataGrid\Microsoft\Windows\Controls\Primitives\DataGridRowsPresenter.cs:line 109       at System.Windows.FrameworkElement.MeasureCore(Size availableSize)

This error does not occur when I remove the event handler attribute.

Furthermore, it seems to be triggered by adding a handler to any type of event, not just the Click event.

Am I maybe overlooking something obvious here?