2011-09-18 58 views
0

有没有使用文档查看器将多个文档绑定到散点图的方法,以便它们全都出现?我知道如何用图像做到这一点,但我认为Document Viewer的行为不同。数据绑定到Microsoft Surface中的文档查看器/ WPF

我的XAML的样子:

<Grid> 
    <s:ScatterView Name="Scatter"> 
     <s:ScatterView.ItemTemplate> 
      <DataTemplate> 
       <DocumentViewer Name="dvDoc" Margin="0, 20, 0, 0" VerticalAlignment="Top" Height="500" Width="300"> 

       </DocumentViewer> 

      </DataTemplate> 
     </s:ScatterView.ItemTemplate> 


    </s:ScatterView> 
</Grid> 

但我知道这是行不通的,因为在程序运行时只有一个的DocumentViewer的实例将被创建。

我的C#是这样的:

var d = new DirectoryInfo(@"c:\users\public\documents"); 
     foreach (FileInfo f in d.GetFiles()) 
     { 
      if (fi.Extension == ".doc") 
      { 
       //Look only for .doc files, convert them to XPS so they can be viewed. 

      } 

     } 

我有转换代码XPS已经但是我无法搞清楚在哪里把这些文件一旦被转换。

回答

0

从未尝试过,只是一个想法:你有没有尝试使用每个ListItem有一个DocumentViewer绑定到一个ObservableCollection的列表框?