我有以下UserControl
。它是TextBox
一个Button
:
<Grid>
<TextBox
Grid.Column="0"
Text="{Binding Text,
RelativeSource={RelativeSource AncestorType=UserControl},
UpdateSourceTrigger=PropertyChanged}"
x:Name="TextBox" />
<Button
Background="{Binding Background, ElementName=TextBox}"
Grid.Column="1"
Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}"
HorizontalAlignment="Right"
Visibility="{Binding IsClearButtonVisible,
RelativeSource={RelativeSource AncestorType=UserControl},
Converter={StaticResource BooleanToVisibilityConverter}}"
Command="{Binding ClearTextCommand,
RelativeSource={RelativeSource AncestorType=UserControl}}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center" >
<Button.Content>
<Image
Source="{StaticResource Delete2}"
Stretch="None"
RenderOptions.BitmapScalingMode="NearestNeighbor"
VerticalAlignment="Center"
HorizontalAlignment="Center" />
</Button.Content>
</Button>
</Grid>
在 Windows 7 中它看起来很棒,但在 Windows XP 中我有以下问题:
关于如何解决这个问题的任何想法?如果我使背景透明,则按钮没有问题,但文本位于按钮下方并且看起来很奇怪。