2个回答
展开全部
string content = File.ReadAllText(@"..\..\FlowDocument1.xaml");
StringReader sr = new StringReader(content);
XmlReader xr = XmlReader.Create(sr);
try
{
FlowDocument doc = (FlowDocument)XamlReader.Load(xr);
fdr1.Document = doc;
}
finally
{
xr.Close();
sr.Close();
}
StringReader sr = new StringReader(content);
XmlReader xr = XmlReader.Create(sr);
try
{
FlowDocument doc = (FlowDocument)XamlReader.Load(xr);
fdr1.Document = doc;
}
finally
{
xr.Close();
sr.Close();
}
追问
我那个写的也对吧?!可是为什么FlowDocument没有那个Document属性啊,是不是缺少哪些引用啊
追答
只有FlowDocumentReader有Document属性。fdr1是FlowDocumentReader的类型喔~
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐于2018-03-29
展开全部
FlowDocument:用高级文档功能(如分页和列)承载流内容和设置流内容格式。
命名空间: System.Windows.Documents 程序集: PresentationFramework(在 PresentationFramework.dll 中)
[<ContentPropertyAttribute("Blocks")>]
[<LocalizabilityAttribute(LocalizationCategory.Inherit, Readability = Readability.Unreadable)>]
type FlowDocument =
class
inherit FrameworkContentElement
interface IDocumentPaginatorSource
interface IServiceProvider
interface IAddChild
end
命名空间: System.Windows.Documents 程序集: PresentationFramework(在 PresentationFramework.dll 中)
[<ContentPropertyAttribute("Blocks")>]
[<LocalizabilityAttribute(LocalizationCategory.Inherit, Readability = Readability.Unreadable)>]
type FlowDocument =
class
inherit FrameworkContentElement
interface IDocumentPaginatorSource
interface IServiceProvider
interface IAddChild
end
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询