首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FlowDocumentScrollViewer FontSize不会更改FlowDocument content FontSize

FlowDocumentScrollViewer FontSize不会更改FlowDocument content FontSize
EN

Stack Overflow用户
提问于 2013-03-18 17:14:44
回答 2查看 1.1K关注 0票数 4

有人能给我解释一下为什么下面的代码不能工作吗

代码语言:javascript
复制
<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,我不知道出了什么问题

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2013-12-18 15:37:24

嗨,在我再次运行同样的问题后,我能够解决这个问题

您可以简单地使用样式进行更改,但前提是FontSize不是固定的

不能工作

代码语言:javascript
复制
    <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>

将在上运行

代码语言:javascript
复制
    <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>
票数 3
EN

Stack Overflow用户

发布于 2013-03-18 17:56:25

看看这个:

代码语言:javascript
复制
        <FlowDocumentScrollViewer >
            <FlowDocument FontSize="50">
                <Paragraph>
                    this text should be FontSize 56
                </Paragraph>
            </FlowDocument>
        </FlowDocumentScrollViewer>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15473141

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档