开发者

Data Binding to Document Viewer in Microsoft Surface/WPF

Is there a way using Document Viewer to bind multiple documents to a scatterview so they all appear? I understand how to do this with images but I think Document Viewer's act diffently.

My XAML looks like :

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

But I know this won't work since only one instance of DocumentViewer will be created when the program is run.

My C# looks like:

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.

            }

        }

I have the conversion code 开发者_Go百科to XPS already but I'm having trouble figuring out where to put the files once they've been converted.


Never tried and just an idea: have you tried to use a listbox bound to an ObservableCollection with each ListItem having a DocumentViewer?

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜