【发布时间】:2010-03-25 14:54:34
【问题描述】:
是否可以设置 SolidColorBrush 的粗细属性。我问的原因是我有一个 IValueConverter 绑定到 Textbox Border BorderBrush 属性,并且我正在动态设置文本框的颜色,
<Window x:Class="MyWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:sys="clr-namespace:System;assembly=mscorlib" Width="600" Height="570">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type TextBlock}" x:Key="Style1">
<Setter Property="BorderBrush" Value="DarkGrey" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style TargetType="{x:Type TextBlock}" x:Key="Style2">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BorderThickness" Value="2" />
</Style>
</ResourceDictionary>
【问题讨论】:
标签: wpf wpf-controls