1
Pivot Excel 도구로 cxml 파일 및 이미지 컬렉션을 생성했습니다. 그런 다음 PivotViewer 컨트롤이 포함 된 양식을 만들어 내 컬렉션 파일을 가리켰습니다. 페이지가 열리고 모든 필터가 빈 화면과 타일이 표시됩니다. 나는 여러 브라우저에서 아무런 노력을하지 못했습니다. 아래는 사용중인 XAML입니다. 다른 게시물의 여기에서 나는 또한 height
/width
/maxheight
/maxwidth
을 조정했습니다. 그 중 아무 것도 도움이되지 않습니다. 어떤 도움을 주셔서 감사합니다! 여기 Silverlight 5 PivotViewer 컨트롤에서 cxml의 이미지 타일을 표시하지 않습니다.
<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;
}
}
}