So let’s continue where the last post left off and finish the high-level pimping of the PivotViewer control…
If you want to follow along then you need to locate the PivotViewerSample code that shipped with the control. By default it is here for the August 2010 release:
C:\Program Files (x86)\Microsoft SDKs\Silverlight\v4.0\PivotViewer\Aug10\Source\PivotViewerSampleXapCode.zip
In the previous post the sample code showed you how to hide the left side Filters Panel and the right side Info Panel. It showed you also how to alter the background to help brand the control’s appearance.
The original code was a bit raw so I have put together a small demo application that wraps the functionality up into the custom PivotViewer class override. The sample allows you to toggle the Visibility of the tiles as well as the filters and information panels.
The custom properties can simply be used as in this sample:
...
if (PivotViewer.TileVisibility == Visibility.Visible)
{
PivotViewer.TileVisibility = Visibility.Collapsed;
}
else
{
PivotViewer.TileVisibility = Visibility.Visible;
}
C# Sample: Hide/Show the collection tiles
And the background can be set to ImageBrush like this:
...
// Main tile view background - ImageBrush
StreamResourceInfo sr = Application.GetResourceStream(new Uri("PimpThePivotViewer;component/Resources/Island.jpg", UriKind.Relative));
BitmapImage bmp = new BitmapImage();
bmp.SetSource(sr.Stream);
PivotViewer.GridBackground = new ImageBrush() { ImageSource = bmp };
sr.Stream.Close();
C# Sample: ImageBrush
The sample has a button to toggle the background between:
You can try out the sample Silverlight application here:
Pimp-the-PivotViewer
Here is the source code for you to play with, if you find it useful, let us know. We have extended the PivotViewer control in other ways to.
Pingback: Tweets that mention Adventures with PivotViewer Part 6: Pimp it sample code | Xpert360 Ltd Development Blog -- Topsy.com
great series!!!!!! keep them coming, i dying to see how you put the buttons in the viewer. curiosity is killing me..
Pingback: Adventures with PivotViewer Part 9: Multi-Layered Trading Cards | Xpert360 Ltd Development Blog
Pingback: Adventures with PivotViewer Part 8: Filter pane tooltips | Xpert360 Ltd Development Blog
Pingback: Xpert360 PivotViewer Blog Article Index | Xpert360 Ltd Development Blog
It is great! Can you please load the source code again, it will be very useful.
Hi, sorry about that, we moved our web hosting recently. I have reinstated the missing ZIP for download.
Thank you very much, you are realy fast.
It seems the source is missing again. Should the link above work?
The source code is missing again, I’ve been trying for days…
I do not have the code with me but will look to restore it next week.
Thanks
Hello.
I thing this page is very useful for me , but the source download it failed.
Can you update the source code? Thank you very much! : )