View.Context conventions issue /w 1.3 & SL5

Topics: Conventions, Framework Services
Jan 6, 2012 at 4:59 AM
Edited Jan 6, 2012 at 5:06 AM

I just spent my afternoon/evening going around in circles and realized there is a breaking change in 1.3 using SL5 and trying to use multiple views with the same ViewModel.  I'm not sure if some of it is because of the third party controls but it seems fairly simple.

I have a Telerik OutlookBar that uses a datatemplate against a set of VM's in an itemsource.  I have a standard version of the view and a contextual version that I'm using in a template.  In 1.2 it worked fine and it works fine now that I have rolled back the CM dll as well as undone all my tinkering.  I tried a simple swap back to 1.3 and it definately does not work. 

My datatemplate is defined as:

<DataTemplate x:Key="MyEpmItemContentTemplate">
            <ContentControl cal:View.Context="Navigation"
                            cal:View.Model="{Binding}"
                            VerticalContentAlignment="Stretch"
                    HorizontalContentAlignment="Stretch" />

        </DataTemplate>

My ViewModel is: Epm.Silverlight.MyEpm.MySitesViewModel My View is: Epm.Silverlight.MyEpm.MySitesView (in the same folder) and I have: Epm.Silverlight.MyEpm.MySites.Navigation (in a nested MySitesfolder)

I have the MySitesViewModel in two separate contentControls nested in the same parent view/viewModel. In 1.2 I get what I expect but with 1.3 the Navigation view doesn't display and once the MySitesView is bound to the where I expect the Navigation view I don't get anything in the second content control.

I tried all sorts of crazy combinatiosn and hacks thinking it was the underlying VM's and the other controls and at one point I thought it did work but I had tried reversing everything and had copies of too much.

I know there are some breaking changes in the convention manager and there are all the changes to the ViewLocator but I don't think I missed anything that was a simple update?

1) Is this an issue/bug? 2) How do I go about debugging to find out where the problem is?

I tried a breakpoint in view.cs -> OnContextedChanged and I can see my 'Navigation' context but the GetModel() method always returned null.

Thanks jack

Jan 6, 2012 at 9:43 PM
Edited Jan 6, 2012 at 9:44 PM

Can you upload a project (in the Issue Tracker section) with the minimum number of files to reproduce the issue? I have a Telerik subscription, so don't worry about including the Telerik binaries.

Jan 9, 2012 at 5:06 PM

This was addressed by your fix for http://caliburnmicro.codeplex.com/discussions/285380 - Thank you kindly.

Jack