标签:cal target oar grid rdf lan sign type 判断
原文:WPF 精修篇 多属性触发器
多属性触发器就是多个属性都满足在触发
在属性触发器上加了一些逻辑判断
举栗子
这个栗子里 textBox 要满足俩个条件 才能触发背景变色
1)textbox的 IsEnabled 为true
2) Texbox获得焦点
- <Window.Resources>
- <Style TargetType="{x:Type TextBox}">
- <Style.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsEnabled" Value="True"></Condition>
- <Condition Property="IsKeyboardFocused" Value="True"></Condition>
- </MultiTrigger.Conditions>
- <MultiTrigger.Setters>
- <Setter Property="Background" Value="Coral"/>
-
- </MultiTrigger.Setters>
- </MultiTrigger>
- </Style.Triggers>
- </Style>
- </Window.Resources>
- <Grid>
- <TextBox x:Name="ss" Text="多属性触发器" VerticalAlignment="Center"></TextBox>
- <TextBox x:Name="ss1" Text="多属性触发器" VerticalAlignment="Center" Margin="0,50,0,0"></TextBox>
-
-
- </Grid>
标签:cal target oar grid rdf lan sign type 判断
原文地址:https://www.cnblogs.com/lonelyxmas/p/12075484.html