Tag Archive: CXML


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? 🙂

Advertisements

After playing with Pivot Viewer for long time, I decided to take one more step of going towards a decentralized approach i.e. storing data in different servers. So, I created 3 servers, one for images another for data (about facets) and one server for Pivot Viewer JIT Collection generation. Everything was well set and all communication working fine and suddenly I couldn’t see images any more in the Pivot Viewer. I checked all the images that my images were accessible from my machine, the data was going to the JIT server properly and also checked all the possible options where an exception could be raised and I didnt find anything…and still no images!

Then I compared the CXML files from the version before and this new setup and I found out that there was no information about the images and I was really pissed…as to what in the world went wrong? Then it struck into my mind to try an access the images on the server where the CXML is being generated and BINGO! The error was even though the images existed and were accessible from the my machine…they were not accessible on the JIT server and as soon as I enabled the access of the images on this server, the images started to show up on the pivot viewer as well.

Come to think about it, its pretty logical and I should have known that this would happen but I didn’t realize until I faced the issue. And sharing this, might help some other poor soul like mine was for the last 2 days.

Cheers!