【发布时间】:2014-04-22 22:26:33
【问题描述】:
我正在尝试在 xaml/C# 中构建一个聊天气泡类型的对话窗口。
但是,我无法从矩形as seen in this screenshot 中删除灰色边框。它应该只是矩形和三角形之间的白色。
这是其中一个气泡的编码图:
<Grid Margin="30, 10, 5, 0"
local:GridUtils.RowDefinitions=",,">
<Rectangle Fill="White"
Grid.RowSpan="2"/>
<TextBox Text="{Binding Path=Text}"
Style="{StaticResource TextBlockStyle}"/>
<TextBlock Text="{Binding Path=Timestamp, Converter={StaticResource StringFormatConverter}, ConverterParameter='ddd, HH:mm'}"
Style="{StaticResource TimestampStyle}"
Grid.Row="1"/>
<Path Data="m 0,0 l 16,0 l 0,16 l -16,-16"
Fill="White"
Margin="0,0,5,0"
HorizontalAlignment="Right"
Grid.Row="2"/>
</Grid>
我尝试了以下方法:
- 使用 stroke/strokethickness 和白色作为颜色
- 删除网格线
- 更改 z 顺序
Google 似乎只提供有关创建边框的提示,而不是删除它。我的代码中没有任何内容应该这样做,会不会是 Windows 主题?
作为参考,here's a screenshot of the same code 但带有<Rectangle Fill="Red">。
【问题讨论】:
-
从 TextBlock 中移除样式。我在没有样式的情况下测试了您的 XAML,但它没有显示您拥有的那一行。