Swap Views Inside ItemsControl using state manager

Topics: Prism v4 - Silverlight 4
Sep 1, 2012 at 3:26 PM
Edited Sep 1, 2012 at 10:05 PM

Is it possible, to use state manager to swap the views loaded inside itemscontrol?

What could be the alternative?

Best Regards

---------- EDITED ------------

I have reviwed the quick start for state-based-navigation, But it works with controls inside the same layout grid.

I mean can this be altered to work on views inside the Itemscontrol after I change it's content to grid control.

please advise.

 

regards

Developer
Sep 3, 2012 at 6:06 PM

Hi,

As far as I know the State Based navigation approach is commonly used when displaying the same data in different styles or formats. If this is your case, this can be seen as you mentioned for example in the State-Based Navigation QuickStart, which displays the contents of a ListBox control using different styles depending on the view's state in its ChatView. In this view, the styles set the ItemTemplate property to specify the DataTemplate that will be used to display each of the items of the ListBox controls. In my opinion, this same approach could be applied when using an ItemsControl.

You can find more information about the suitable scenarios for using State Based navigation approach, and more information about the use of the Visual State Manager in the following resources:

I hope you find this useful,

Agustin Adami
http://blogs.southworks.net/aadami

Sep 5, 2012 at 6:36 AM

Hello Aadami,

I solve my problem using this principle:

1- I used a TransitionControl to be responsible of swapping the usercontrols in/out the ItemsControl.

2- Every usercontrol has its own responsibility to change the view using state-based navigation.

Best regards