Upgrading to the latest Telerik release results in a NullReferenceException in Caliburn Micro ActionMessage.SetMethodBinding on application load. The issue is specific to the ExecuteOnLoad event handler Sequence which tries to resolve bindings for the control that is loading.
In our case, the control is a RadButton. The Exception is thrown when the Source property of the ActionExecutionContext in Caliburn Micro is dereferenced. The Source property is set to the value of the ActionMessage’s AssociatedObject property when the object is constructed a few frames higher on the call stack.
For some reason, the AssociatedObject property is set correctly with the Button controls in the prior telerik release, but not with this latest one.
Additionally, this problem is specific to Caliburn Micro Actions set up in Styles vs. on the control itself. IOW this code causes the exception:
<Style x:Key="FooStyle" TargetType="telerik:RadButton">
<Setter Property="ToolTip" Value="Foo Tip"/>
<Setter Property="cal:Message.Attach" Value="[Click]=[Foo]"/>
</Style>
<telerik:RadButton x:Name="_fooButton" Style="{StaticResource FooStyle}"/>
While this code does not
<Style x:Key="FooStyle" TargetType="telerik:RadButton">
<Setter Property="ToolTip" Value="Foo Tip"/>
</Style>
<telerik:RadButton x:Name="_fooButton"
Style="{StaticResource FooStyle}"
cal:Message.Attach = "[Click]=[Foo]"/>
Again, setting the Message.Attach property in a style worked fine in the last Telerik release. It causes an exception in this latest release.
We have many buttons in our application that are styled like this and it will be a large effort to convert them as a workaround in order to use the latest Telerik controls. Before we do so, we’d like to know what changed and whether there is a less invasive workaround.