This is a migrated thread and some comments may be shown as answers.

Breaking Change in Q1 2013 release with Caliburn Micro

3 Answers 94 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Timothy
Top achievements
Rank 1
Timothy asked on 01 Mar 2013, 05:45 PM

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.

3 Answers, 1 is accepted

Sort by
0
Timothy
Top achievements
Rank 1
answered on 01 Mar 2013, 07:16 PM
While waiting for an answer, I went ahead and started changing styles as shown in the original post.  I got enough of them changed over to get my application to load and quickly saw that the REAL PROBLEM is that none of the styles are being applied - not just the CM properties needed for method binding.

I'm currently looking at the way we compose toolbars to see what might cause this to occur, but it's definitely NOT a Caliburn Micro problem.

Any thoughts on what changed in the latest release that might negatively affect the application of styles to RadButtons would be appreciated!
0
Timothy
Top achievements
Rank 1
answered on 04 Mar 2013, 03:14 PM
After more investigation, it's obvious that this is a problem with the latest RadToolbar.  I created a new thread in that specific forum.  You can find it here: http://www.telerik.com/community/forums/wpf/toolbar/toobar-button-properties-are-not-being-set-in-q1-2013-release.aspx

0
Tina Stancheva
Telerik team
answered on 05 Mar 2013, 04:50 PM
Hello Timothy,

Thank you for your detailed report. As we've already notified you, we logged this as a bug. In case anyone else encounters the same issue, you can track the task progress from our PITS.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
Timothy
Top achievements
Rank 1
Answers by
Timothy
Top achievements
Rank 1
Tina Stancheva
Telerik team
Share this question
or