Category Archives: Wp7AppHub

Xpert360 PivotViewer Blog Article Index

[Last updated: 2011-06-22]
Introduction
This post is intended to be a landing place to bring together links to our growing collection of PivotViewer articles in one place. We will update this article to reflect new blog posts and other useful links.
If you are not familiar with overriding the Silverlight PivotViewer control’s OnApplyTemplate() method then I recommend taking the time to work through the posts in the ‘Adventures with PivotViewer’ series and build up your portfolio of customization skills.
These articles are based on the version of the control shipped separately from the Silverlight 4 SDK. We will update and extend articles with information relevant to Silverlight 5 SDK as they become available. If you are already customizing your PivotViewer experience then dive right in:
Adventures with PivotViewer
PivotViewer Shorts
PivotViewer Miscellaneous
Examples on the Internet
Further things to do and resources
Conclusion
This article is an anchor page to our blog articles concerning the Silverlight PivotViewer control. There are a range of articles topics and technical levels. Some target the developer who is ready to start customizing the Silverlight PivotViewer control beyond the documented public API, whilst others show examples of what can be achieved.
Any comments or request for future topics are welcome.

MIX11 OpenCall Voting – Session picker

MIX11 PivotViewer Sessions containing Geolocation

MIX11 PivotViewer Sessions containing Geolocation

We are really looking forward to MIX11 and with 207 sessions to choose from, we decided to take a couple of hours and put together a Pivot collection to provide a little help with narrowing down exactly which sessions you want to vote for.

Run the Silverlight MIX11 OPEN CALL application. As with all silverlight apps, works fine on most browsers and OS.

MIX11 PivotViewer Sessions on Razor

MIX11 PivotViewer Sessions on Razor

MIX11 PivotViewer Session Speakers

MIX11 PivotViewer Session Speakers

Adventures with PivotViewer Part 8: Filter pane tooltips

Introduction
Adding tooltips to the left side filter pane not surprisingly requires the use of a customized PivotViewer control:
You should be familiar with the following line of code to get the CollectionViewerView from earlier blog posts and samples.
CollectionViewerView cvv =
((CollectionViewerView)((Grid)
this.GetTemplateChild(“PART_Container”)).Children[0]);
If you are not familiar with this then I would recommend taking the time to work through the other posts in this series and build up you portfolio of PivotViewer customization skills.

Locating the UI Elements and attaching ToolTips
Tooltips can be set on controls in code behind using the ToolTipService. Normally you might use the ToolTip attached property of the ToolTipService class and the ToolTip control in your XAML.
The flow of the code goes something like this:

  • Locate the “PART_FacetPane” in the tree. This is a CustomAccordian control.
  • Locate the CustomAccordianItem‘s ( == facets)
  • … under each item is a FacetCategory control to find the facet category name.
  • … use the TooltipService to set custom tooltips on the CustomAccordianItem‘s
FilterPaneView FPV = (FilterPaneView)PivotViewer.CollectionView.FindName(“PART_FilterPane”();
CustomAccordion FacetPane = (CustomAccordion)FPV.FindName(“PART_FacetPane”);
StackPanel itemsHost = (StackPanel)FacetPane.GetItemsHost();
for (int nitem = 0; nitem < itemsHost.Children.Count; nitem++)
{
CustomAccordionItem item = (CustomAccordionItem)itemsHost.Children[nitem];
// tooltip for facet category header
stringtooltip;
string facetName = ((FacetCategory)item.Content).Name;
switch(facetName){
case “AppCount”:tooltip = “Count of applications in the Marketplace”;
break;
case “Ranking”:tooltip = “Overall ranking in the Marketplace”;
break;

ToolTipService.SetToolTip(item, “Facet:\n”+ tooltip);

If you take a look at this set of pivot collections, visualizing the WP7 Marketplace, you will see facet tooltips are implemented:
WP7 APP HUB
FAQ
If you want to try out the code there are a few things to watch out for. You will not be able to set the tooltips before the collection event CollectionLoadingCompleted has completed and exited. If you wrap your tooltip code in a function then you can call it from this event using the control’s dispatcher:
this.Dispatcher.BeginInvoke(SetToolTips);
You will need some internal Microsoft Pivot references and usings too. Depending upon the extent of your other customizations you will need these:
using System.Windows.Pivot;
using Microsoft.Pivot.Internal.Controls;
using Microsoft.Pivot.Internal.Model;
using Microsoft.Pivot.Internal.ViewModels;
using Microsoft.Pivot.Internal.Views;
Further things to do

 

Conclusion
This article is just a brief tutorial that includes the key features of using the tooltip service control in code to attach custom tooltips to visual elements of the Silverlight PivotViewer control. It targets the developer who has already started customizing the Silverlight PivotViewer control beyond the public API. Any comments or request for future topics are welcome.