是否有可能设置的SolidColorBrush的厚度方向性能。我问的原因是,我有一个的IValueConverter绑定到文本框边框BorderBrush属性和我动态设置文本框的颜色,的SolidColorBrush厚度财产
<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>
你能告诉我怎么用IValueConverter做这件事吗? – developer 2010-03-25 15:04:48
请参阅如何访问样式... – TabbyCool 2010-03-25 16:53:38
我想我的贴转换器的代码编辑答案。你可以编辑它,并告诉我如何使用样式添加边框的厚度和颜色。我是wpf的新手,所以如果你可以请求帮助。 – developer 2010-03-25 17:17:48