C# Windows IoT 核心 - 在图像网格上的文本块中显示和滚动文本

C# Windiws IoT core - Display and Scroll text in Textblock over an Image Grid

使用 Windows 物联网核心从事物联网项目。到目前为止,图像、视频和音频能够显示在显示器上。需要在底部添加滚动文本

目前开发的代码 XAML 是:

<Page
x:Class="Digital_Notiec_Board_V1._2.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Digital_Notiec_Board_V1._2"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="#FF222222" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">



    <Image x:Name="imageInstance" Visibility="Collapsed" />
    <MediaElement x:Name="audioInstance" Visibility="Collapsed" />
    <MediaElement x:Name="videoInstance" Visibility="Collapsed" />
    <TextBlock x:Name="ScrollText" HorizontalAlignment="Left" Height="63" Margin="0,1017,0,0" TextWrapping="Wrap" Text="TextBlock" VerticalAlignment="Top" Width="1910" FontSize="36" Foreground="White"/>


    <!--
    <WebView x:Name="webViewInstance" Visibility="Collapsed"/>
    -->
</Grid>

请帮我出出主意。如果可能的话,任何基地都要检查。

提前致谢

您可以使用 ScrollViewer to represent the text area.Please refer to following XAML codes.To make your app responsive and adaptive,it is a good choice to use XAML properties and layout panels.Please reference Define page layouts with XAML.

<Page
x:Class="Digital_Notiec_Board.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Digital_Notiec_Board"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Grid Background="#FF222222" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">

    <Grid.RowDefinitions>
        <RowDefinition MaxHeight="200"></RowDefinition>
        <RowDefinition MaxHeight="200"></RowDefinition>
        <RowDefinition MaxHeight="200"></RowDefinition>
        <RowDefinition Height="*"></RowDefinition>
    </Grid.RowDefinitions>

    <Image x:Name="imageInstance" Visibility="Collapsed" Grid.Row="0"/>
    <MediaElement x:Name="audioInstance" Visibility="Collapsed" Grid.Row="1"/>
    <MediaElement x:Name="videoInstance" Visibility="Collapsed" Grid.Row="2"/>
    <ScrollViewer Grid.Row="3">
        <TextBlock x:Name="ScrollText" TextWrapping="Wrap" Foreground="White" Text="TextBlock" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollMode="Auto">

        </TextBlock>
    </ScrollViewer>
</Grid>