我使用Pivot Excel工具生成了cxml文件和图像集。然后我创建了一个带有PivotViewer控件的表单,并将其指向我的收集文件。页面打开,显示我的所有过滤器只有一个空白表面,没有瓷砖。我在几个浏览器中尝试过无济于事。下面是我正在使用的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;
}
}
}
答案 0 :(得分:0)
显然Chrome 16不会渲染数据透视表。将我的默认浏览器切换到IE,一切都很顺利。