Silverlight 4.0 在手风琴的文本块包装后浪费第四个小时

Silverlight 4.0 在手风琴的文本块包装后浪费第四个小时,silverlight-4.0,Silverlight 4.0,为什么这不起作用:- <toolkit:Accordion x:Name="___No_Name_" Margin="0" SelectionMode="OneOrMore" HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="{Binding ActualWidth, ElementName=grid}" > <toolkit:Accordi

为什么这不起作用:-

<toolkit:Accordion x:Name="___No_Name_"  Margin="0"  SelectionMode="OneOrMore" HorizontalAlignment="Stretch" VerticalAlignment="Top" Width="{Binding ActualWidth, ElementName=grid}"
                       >
        <toolkit:AccordionItem Header="Welcome" Margin="10,0" IsSelected="True" >
             <TextBlock Margin="3" TextWrapping="Wrap" Text="This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone " FontFamily="Verdana" FontSize="13.333" Foreground="#FF033C68"/>
        </toolkit:AccordionItem>
        <toolkit:AccordionItem Header="Family news" Margin="10,0" />
        <toolkit:AccordionItem Header="Random photos" Margin="10,0" />
        <toolkit:AccordionItem Header="News articles" Margin="10,0" />
    </toolkit:Accordion>

我只能看到第1行。其余的内容被剪辑。为什么即使我有一个环绕文本块,高度也不会自动设置?为什么这个控制这么折磨我?我做错了什么?为什么我不能使用此控件获得正常的预期行为

即使是最简单的标记也不起作用

<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" x:Class="SilverlightApplication3.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <Grid x:Name="LayoutRoot" Background="White">

        <toolkit:Accordion HorizontalAlignment="Stretch" Margin="0">
            <toolkit:AccordionItem  Header="Header">
                <TextBlock Text="This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a great system that allows anyone This site was created using FMT. This is a " TextWrapping="Wrap"/>
            </toolkit:AccordionItem>
        </toolkit:Accordion>

    </Grid>
</UserControl>

除非
TextBlock
也设置了
宽度,否则
TextBlock
中的文本不会换行


我采用了您的“最简单的标记”,将
Width=1000
添加到
TextBlock
中,并按照我的预期包装文本。

除非
TextBlock
也设置了
宽度,否则
TextBlock
中的文本不会包装


我采用了您的“最简单的标记”,将
Width=1000
添加到
TextBlock
中,并按照我的预期对文本进行了包装。

我想我找到了问题所在。手风琴在scrollviewer中,这是导致问题的原因。不确定。毫无疑问,我错了。请阅读我编辑过的文章。我有一个类似的问题,我在文本的几个段落中有一些元素。看起来,AccordionItem的高度是基于一行上的每个段落设置的,然后应用环绕以扩展渲染文本的高度,但是,AccordionItem的高度不会展开,文本块将在环绕前的高度处剪裁。然而,我还不确定是什么原因造成的。我想我找到了问题所在。手风琴在scrollviewer中,这是导致问题的原因。不确定。毫无疑问,我错了。请阅读我编辑过的文章。我有一个类似的问题,我在文本的几个段落中有一些元素。看起来,AccordionItem的高度是基于一行上的每个段落设置的,然后应用环绕以扩展渲染文本的高度,但是,AccordionItem的高度不会展开,文本块将在环绕前的高度处剪裁。但是,我不确定这是什么原因。-我不希望我的文本块上设置明确的宽度。最后我扔掉了手风琴,放上了静态扩展器,在我的例子中效果很好,我不需要在任何控件上设置任何显式宽度。无论如何,谢谢:)-我不想在我的文本块上设置明确的宽度。最后我扔掉了手风琴,放上了静态扩展器,在我的例子中效果很好,我不需要在任何控件上设置任何显式宽度。无论如何,谢谢你:)