开发者

Silverlight Won't Load PivotViewer Collection

I'm trying to get a proof-of-concept PivotViewer application up and running, but I can't get the collection to load properly, even in a testing environment. I'm following these instructions:

Building Your First PivotViewer Application

I have a clientaccesspolicy XML file in the root, giving all URIs access. I copied an already existing collection, and have it in the root as well. The collection XML checks out properly.

Whenever I attempt to debug the application, however, it loads but simply displays the URL for the collection, never actually building the PivotViewer.

MainPage.xaml:

<UserControl x:Class="PivotViewer.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:Pivot="clr-namespace:System.Windows.Pivot;as开发者_如何学运维sembly=System.Windows.Pivot"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">
        <Pivot:PivotViewer x:Name="Pivot" />
    </Grid>
</UserControl>

MainPage.xaml.cs:

namespace PivotViewer
{
    public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            Pivot.LoadCollection("http://localhost:55334/Top_Movies.cxml", string.Empty);
        }
    }
}


OK, here's a number of ways forward for you.

Firstly, wire up the PivotViewer's CollectionLoadingFailed event before calling the LoadCollection method. This will expose a CollectionErrorEventArgs containing any exceptions.

Secondly, install Fiddler2 and use it to watch what the PivotViewer is requesting. If it's failing to reach certain parts of the pivot collection it will be very obvious.

Let me know what those 2 suggestion bring to light.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜