2

我想在一个滚动查看器中有文本块和超链接按钮,但它说属性内容设置了不止一次......

        <!--ContentPanel - place additional content here-->

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0">
            <ScrollViewer>
                <TextBlock HorizontalAlignment="Left" Margin="1,15,0,85" Width="460" Height="1500" Name="TextBlock1" TextWrapping="Wrap"> 
            <LineBreak />
        <Run FontFamily="Segoe WP" FontSize="27" FontWeight="ExtraBlack" TextDecorations="Underline">
           Weider 6 pack Training is a perfect exercise for flat stomach. 
            </Run>
            <LineBreak />
        <Run Text="This easy training programme has many advantages." FontSize="27" />
        <LineBreak />
        <Run Text="1. It's perfect for beginners and for experts" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" />
        <Run Text=" – exercises are easy and begin with the basic level, so every beginner can use them but they get more complicated pretty fast so advanced sportsmen can also be interested in them." FontSize="27" />
        <LineBreak />
        <Run Text="2.It helps not only carve your muscles but also burn fat" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" />
        <Run Text=" – during the exercise you not only use your abdominal rectus but you also move your legs and arms. It is also because W6 puts pressure on the number of repetitions. It carves your muscles but also burns fat. You can train W6 for about 40 minutes without taking any breaks – you use up all glycogen in blood and start burning the fat." FontSize="27" />
        <LineBreak />
        <Run Text="3.It is easy " FontStyle="Normal" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" />
        <Run Text="– it is a really easy training set which you can train almost anywhere. All you need is flat ground." FontSize="27" />
        <LineBreak />
        <Run Text="4.It gives excellent results" FontStyle="Normal" FontWeight="ExtraBlack" TextDecorations="Underline" FontSize="27" />
        <Run Text=" – if you want to have a flat stomach W6 is designed just for you. You can see the first effects after just a week and after a whole series it is really impressive." FontSize="27" />"
        <LineBreak />
                </TextBlock>
            <HyperlinkButton Content="HyperlinkButton" Height="30" HorizontalAlignment="Left" Margin="144,489,0,0" Name="HyperlinkButton1" VerticalAlignment="Top" Width="200" />
        </ScrollViewer>

    </Grid>

</Grid>
4

2 回答 2

5

ScrollViewer 中有两个控件:Textblock 和 HyperlinkBut​​ton。将它们分组到一个网格中。

于 2012-04-30T13:22:18.897 回答
1

您应该将其包装在 aStackPanel或 aGrid中。这样,您仍然可以设置Content一次属性,但其中包含多个项目。

于 2012-04-30T13:20:58.240 回答