Silverlight 5 PivotViewer control not showing image tiles from cxml

1.2k views Asked by At

I've generated a cxml file and image collection with the Pivot Excel tool. I then created a form with a PivotViewer control in it, and pointed it at my collection file. The page opens, shows all of my filters with just a blank surface, no tiles. I've tried in several browsers to no avail. Below is the XAML I'm using. From other posts here I've also adjust height/width/maxheight/maxwidth, and none of that helps. Any help is appreciated!

    <UserControl x:Class="Pivot.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pv="clr-namespace:System.Windows.Controls.Pivot;assembly=System.Windows.Controls.Pivot"
mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400">

<Grid x:Name="LayoutRoot" Background="White">
    <pv:PivotViewer Name="pvViewer" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>

Here is the code-behind

public partial class MainPage : UserControl
{
    public MainPage()
    {
        InitializeComponent();
        pvViewer.Loaded += new RoutedEventHandler(pvViewer_Loaded);
    }

    readonly string CXML_PATH = @"C:\Users\joshh\Documents\R&D\Pivot\PDP.cxml";
    private CxmlCollectionSource _cxml;
    void pvViewer_Loaded(object sender, RoutedEventArgs e)
    {
        _cxml = new CxmlCollectionSource(new Uri(CXML_PATH, UriKind.Absolute));
        _cxml.StateChanged += new EventHandler<CxmlCollectionStateChangedEventArgs>(_cxml_StateChanged);
    }

    void _cxml_StateChanged(object sender, CxmlCollectionStateChangedEventArgs e)
    {
        if (e.NewState == CxmlCollectionState.Loaded)
        {
            pvViewer.PivotProperties = _cxml.ItemProperties.ToList();
            pvViewer.ItemTemplates = _cxml.ItemTemplates;
            pvViewer.ItemsSource = _cxml.Items;
        }
    }
}
1

There are 1 answers

0
pianomanjh On BEST ANSWER

Apparently Chrome 16 won't render the PivotViewer. Switched my default browser to IE and all is well.