有人能给我解释一下为什么下面的代码不能工作吗
<UserControl x:Class="FlowDocReader.FlowDocumentScrollViewerIssues"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<FlowDocumentScrollViewer FontSize="56">
<FlowDocument>
<Paragraph>
this text should be FontSize 56
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>
</UserControl>如你所见,FontSize不是56,我不知道出了什么问题
发布于 2013-12-18 15:37:24
嗨,在我再次运行同样的问题后,我能够解决这个问题
您可以简单地使用样式进行更改,但前提是FontSize不是固定的
不能工作
<FlowDocumentScrollViewer FontSize="56">
<Style TargetType="{x:Type FlowDocument}">
<Setter Property="FontSize" Value="56"/>
</Style>
<FlowDocument FontSize="56">
<Paragraph>
this text should be FontSize 56
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>将在上运行
<FlowDocumentScrollViewer FontSize="56">
<Style TargetType="{x:Type FlowDocument}">
<Setter Property="FontSize" Value="56"/>
</Style>
<FlowDocument>
<Paragraph>
this text should be FontSize 56
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>发布于 2013-03-18 17:56:25
看看这个:
<FlowDocumentScrollViewer >
<FlowDocument FontSize="50">
<Paragraph>
this text should be FontSize 56
</Paragraph>
</FlowDocument>
</FlowDocumentScrollViewer>https://stackoverflow.com/questions/15473141
复制相似问题