Skip to main content

Microsoft Silverlight

Answered Question RIA Services using TransitioningContentControlRSS Feed

(0)

Kieran Cumming
Kieran C...

Member

Member

0 points

1 Posts

RIA Services using TransitioningContentControl

 Hi all,

 I've got a question regarding how to best apply RIA Services to my scenario. I currently have the RIA Services go and fetch some list data from a SharePoint site and then display it to users using a TransitioningContentControl. The problem is that when transitioning content, because the DomainDataSource's DataView has moved to previous/next, the existing object is no longer referenced, which means the TCC's transition does not look correct.

 When the user clicks next/previous, the DataView changes to the next/previous item correctly, however the view on the existing item is not maintained for it to be transitioned out. The existing item just disappears the moment the next item is loaded. The relevant code is as follows:

  

<riaControls:DomainDataSource x:Name="listObjectsDataSource" ... />
<layoutToolkit:TransitioningContentControl x:Name="tccScroller" Content="{Binding Data, ElementName=listObjectsDataSource}">
   ...
</layoutToolkit:TransitioningContentControl>

 

There are buttons outside of the TCC that trigger the transition. Example code from one of them:

 

tccScroller.Transition = "LeftTransition";
listObjectsDataSource.DataView.MoveCurrentToPrevious();
if (listObjectsDataSource.DataView.IsCurrentBeforeFirst) listObjectsDataSource.DataView.MoveCurrentToLast();
tccScroller.DataContext = listObjectsDataSource.DataView.CurrentItem;
// must explicitly call GoToState to trigger transition
// because the TCC's 'Content' is not actually changing
// to automatically trigger it, just the DataContext
VisualStateManager.GoToState(tccScroller, tccScroller.Transition, true);

 

Am I doing something wrong here? Is there a simple way to have the binding keep the reference to the 'previous' item for the duration of the transition?

Cheers

Mog Liang - MSFT
Mog Lian...

All-Star

All-Star

15962 points

1,552 Posts

Answered Question

Re: RIA Services using TransitioningContentControl

Hi,

Are you trying to display currentitem in TransitionContentControl? if so, you need set ttcScroller.Content in code instead of setting datacontext.

Thanks,

Mog Liang
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities