我MultiDataTrigger
在多行中使用TextBox
:
<TextBox TextWrapping="Wrap" ScrollViewer.CanContentScroll="True"
FlowDirection="RightToLeft" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto"
Text="{Binding ArabicDescription}" IsReadOnly="True">
<TextBox.Style>
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=EnableNewEntry}" Value="True" />
<Condition Binding="{Binding Path=AllowArabic}" Value="True" />
</MultiDataTrigger.Conditions>
<Setter Property="IsReadOnly" Value="False" />
<Setter Property="Background" Value="Blue" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
当EnableNewEntry
和AllowArabic
变为真时,TextBox
应该变为只读。为了测试,我也改变了背景颜色。问题是在适当变化的IsReadOnly
地方没有变化。Background
我也尝试了以下设置器,但它也不起作用:
<Setter Property="TextBox.IsReadOnly" Value="False" />
我究竟做错了什么?
里特什