我正在尝试使用嵌入的放大镜图标进行搜索文本框。到目前为止,我有以下标记:
<Border DockPanel.Dock="Bottom" Margin="2,4,0,4"
BorderThickness="1" SnapsToDevicePixels="True"
BorderBrush="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}">
<DockPanel>
<StackPanel Orientation="Horizontal" DockPanel.Dock="Right">
<Image Source="/Resources/search-13x13.png" Width="13"/>
</StackPanel>
<TextBox Name="searchTextBox" DockPanel.Dock="Bottom" BorderThickness="0"
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}"/>
</DockPanel>
</Border>
但是,我在 SystemColors 中找不到与标准 TextBox 边框颜色相同的条目。默认情况下,这是一种蓝色。我在这里真的很愚蠢吗?!?
编辑:顺便说一句,图像包含在堆栈面板中,因为我也打算在其中放置一个下拉箭头。