Confused on how to wire up the transitioning content control for multiple view models

Feb 13, 2011 at 11:34 PM
Edited Feb 13, 2011 at 11:34 PM

I'm reading the article here: http://caliburnmicro.codeplex.com/wikipage?title=Screens,%20Conductors%20and%20Composition&referringTitle=Documentation

but I'm having a hard time understanding what I do with the 

cal:View.Context="{Binding State, Mode=TwoWay}"

I see the paragraph that tries to explain how the naming convention works but I'm still not quite getting it. In my project I have one place where I need to show a details view so I need to swap out a second screen. I don't exactly want to restructure my entire app to suite the hybrid view but I'd like to use the same concept. I made a folder/namespace called Users inside my View structure.. Inside that I put my Detail.xaml. My Original view is called UsersView.xaml. I added a variable called "State" to my UsersViewModel. I changed State to "Details" and NotifyOfPropertyChanged but nothing happens.

Coordinator
Feb 13, 2011 at 11:55 PM

Try "Detail" singular or rename the view to match.

Feb 14, 2011 at 2:17 AM
Edited Feb 14, 2011 at 2:19 AM

When I make my transitioning control like the example it seems to get stuck in an infinite loop:

 

<clt:TransitioningContentControl cal:View.Context="{Binding State, Mode=TwoWay}"
                                 cal:View.Model="{Binding}" 
                                 Style="{StaticResource specialTransition}"/>
[2011-02-13T21:16:10.4072266-05:00] Setting DC of Proj.Views.ShellView to Proj.ViewModels.ShellViewModel.
[2011-02-13T21:16:10.4091797-05:00] Setting DC of System.Windows.Controls.ComboBox to Proj.ViewModels.JobsViewModel.[2011-02-13T21:16:10.4101563-05:00] 
Attaching message handler Proj.ViewModels.JobsViewModel to System.Windows.Controls.ComboBox.[2011-02-13T21:16:10.4111328-05:00] 
Binding Proj.Views.ShellView and Proj.ViewModels.ShellViewModel.[2011-02-13T21:16:10.4121094-05:00] 
Setting DC of Proj.Views.ShellView to Proj.ViewModels.ShellViewModel.[2011-02-13T21:16:10.4140625-05:00] 
Setting DC of System.Windows.Controls.ComboBox to Proj.ViewModels.JobsViewModel.

If I remove the line cal:View.Model="{Binding}" it doesn't loop. Is this part important? Because with it removed as soon as I change the State I get an error saying the view cannot be found. I've checked everything and it looks to be alright. Could it be because I'm doing it without that line?

Coordinator
Feb 14, 2011 at 3:18 AM

Are you using the latest Trunk? I made some bug fixes in this area recently.