Seeking clarity on View.Context and HelloScreens sample

Apr 28, 2011 at 4:07 PM

In the HelloScreens sample, which I am basterdizing for my own new framework, there is the WorkspaceDocumentState enum {Detail,Master}.

The CustomerWorkspaceView has the following XAML:

<clt:TransitioningContentControl cal:View.Context="{Binding State, Mode=TwoWay}" cal:View.Model="{Binding}" Style="{StaticResource specialTransition}"/>
 
Which magically (I'm assuming via the conventions) becomes the /CustomerWorkSpace/Master or Detail views.
1) Am I missing something or does the ViewLocator actullay take the text label of the enumeration and convert that to the string?
2) Is this a recommended approach to provide multiple views for a single ViewModel? I have a Telerik TileView control that I want to use 
   to show three different views of the same data based on Maximize/Minimize/Restore sized tiles.
	MyDataViewModel -> MyDataCardView, MyDataDetailView, MyDataListItemView   etc.
Thanks
jack
Apr 29, 2011 at 9:57 AM

Hi jack,

1) Yes, that's pretty much what goes on.

2) It'd be something like that, however the views would all be in a MyData namespace and called Card, Detail, ListItem respectively.  Not sure how you'd go about switching the Context for the tile view but it will likely be simple enough.

Apr 29, 2011 at 2:03 PM

Thank you for the clarification. It maybe that I end up using a DataTemplateSelector instead with the RadTileView. They also have a enumeration for the TileState that I can probably use as well.

From: gmcnicol [email removed]
Sent: Friday, April 29, 2011 3:58 AM
To: jaddington@alexandergracie.com
Subject: Re: Seeking clarity on View.Context and HelloScreens sample [caliburnmicro:255581]

From: gmcnicol

Hi jack,

1) Yes, that's pretty much what goes on.

2) It'd be something like that, however the views would all be in a MyData namespace and called Card, Detail, ListItem respectively. Not sure how you'd go about switching the Context for the tile view but it will likely be simple enough.