小编use*_*083的帖子

C#更改backgroundcolor特定行

我已经从Grid App(XAML)模板(C#Windows Store)创建了一个新项目.到目前为止,我在模板中没有改变任何内容,但我想从网格中的特定行更改backgroundcolor.

<!--
    This grid acts as a root panel for the page that defines two rows:
    * Row 0 contains the back button and page title
    * Row 1 contains the rest of the page layout
-->
<Grid Style="{StaticResource LayoutRootStyle}">
    <Grid.RowDefinitions>
        <RowDefinition Height="140"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
Run Code Online (Sandbox Code Playgroud)

我想从第0行(包含页面标题)更改backgroundcolor.有任何想法吗??提前致谢!

这一行构成:

    <!-- Back button and page title -->
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
        <TextBlock x:Name="pageTitle" Text="{StaticResource AppName}" Grid.Column="1" IsHitTestVisible="false" Style="{StaticResource PageHeaderTextStyle}"/> …
Run Code Online (Sandbox Code Playgroud)

c# silverlight wpf xaml

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

c# ×1

silverlight ×1

wpf ×1

xaml ×1