Wednesday, June 30, 2010

Way to access current Item's facets in Microsoft LiveLabs Silverlight PivotViewer control

Here is the simple way to access PivotViewer's current selected item and its facets.

PivotItem pi = pivotViewer.GetItem(pivotViewer.CurrentItemId);

if (pi.Facets.ContainsKey("My facet name"))

        textBlock.Text = pi.Facets["My facet name"][0];
 
To Access Title,
            pi.Name

For Description, you need to use similar to facet.
             pi.Facets["Description"][0];

For URL or Href,

          pi.Href

No comments:

Post a Comment