Quantcast
Channel: Akshaya's World » Silverlight
Viewing all articles
Browse latest Browse all 6

Refreshing Pivot Viewer properties and templates

$
0
0

In the past, many times I have come around a situation where I want to load a completely different set of facets in the Pivot Viewer without really instantiating a new instance of it! While in the Pivot Viewer’s first version it was relatively simpler (by just loading a different cxml) but in the second version it didn’t work right, when I was using the client-side loading of items. There was always something that didn’t work example the filter pane wouldn’t show the facets of the new collection, etc. But, there’s a very simple solution for this (actually it was too simple to be believable for the first time…at least for me), so here it is…before you set the new PivotProperties and the Templates, just write down the following 3 lines:

ItemPivot.ItemsSource = null;
ItemPivot.PivotProperties.Clear();
ItemPivot.ItemTemplates.Clear();

Thats it! And you’ll never face a problem in loading a new set of items following a different structure again! Kapish? :)


Filed under: Code Tagged: CXML, Pivot, PivotViewer, Silverlight, software, Technology

Viewing all articles
Browse latest Browse all 6

Latest Images

Trending Articles





Latest Images