1

Pivot Excel ツールを使用して、cxml ファイルと画像コレクションを生成しました。次に、Pivo​​tViewer コントロールを含むフォームを作成し、コレクション ファイルをポイントしました。ページが開き、すべてのフィルターが表示され、表面は空白でタイルは表示されません。いくつかのブラウザーで試してみましたが、役に立ちませんでした。以下は私が使用しているXAMLです。ここの他の投稿から、 height/ width/ maxheight/も調整しましたmaxwidthが、どれも役に立ちません。どんな助けでも大歓迎です!

    <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>

ここにコードビハインドがあります

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;
        }
    }
}
4

1 に答える 1

0

どうやら Chrome 16 は PivotViewer をレンダリングしません。デフォルトのブラウザを IE に切り替えたところ、問題なく動作しました。

于 2012-01-11T02:24:10.297 に答える