0

画像ボタンのスタイルは次のようになっていますが、TextBlockのテキストを作成するにはどうすればよいですか。下の「POSITION」はボタンのコンテンツと同じです。ありがとうございます。`

<Style x:Key="TopButtonStyle" TargetType="Button">
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Button.BorderBrush" Value="SteelBlue" />
        <Setter Property="Button.BorderThickness" Value="0" />

        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid Background="SteelBlue">
                        <Image Source="images/blue_button_up.png" HorizontalAlignment="Center" Margin="0,0,0,0" Height="Auto" Width="Auto" Stretch="UniformToFill"/>
                        <TextBlock Text="POSITION" HorizontalAlignment="Center" Foreground="White" Margin="5,5,0,0"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>`
4

1 に答える 1

1

{Binding}DataContextContentTemplateですContent

于 2012-07-11T22:46:09.530 に答える