zoukankan      html  css  js  c++  java
  • 学习WPF里的ListBox控件的Triggers

    <ControlTemplate.Triggers>
                                
    <Trigger Property="IsSelected" Value="true"<!-- 当Item选中时 -->
                                    <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/> <!-- x:Name="Bd"的控件的背景 设置为系统颜色 -->
                                    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/> <!-- 字体颜色 -->
                                    <Setter Property="Fill" TargetName="PathSelected" Value="Red"></Setter<!-- x:Name="PathSelected" 路径的填充颜色为红色 -->
                                    <Setter Property="Visibility" TargetName="PathSelected" Value="Visible"/> <!-- x:Name="PathSelected" 显示 -->
                                </Trigger>
                                
    <MultiTrigger>  <!-- 此为组合条件 -->
                                    <MultiTrigger.Conditions>
                                        
    <Condition Property="IsSelected" Value="true"/> <!-- 条件一 选中 -->
                                        <Condition Property="Selector.IsSelectionActive" Value="false"/> <!-- 条件二 我理解为失去焦点 -->
                                    </MultiTrigger.Conditions>
                                    
                                    
    <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                                    
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
                            
                                
                                
    </MultiTrigger>
                                
    <Trigger Property="IsEnabled" Value="false">
                                    
    <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
                                
    </Trigger>
                            
    </ControlTemplate.Triggers>
                        
    </ControlTemplate>
  • 相关阅读:
    东南亚“美团” Grab 的搜索索引优化之法
    linux中init.d文件夹的说明
    缓存踩踏:Facebook 史上最严重的宕机事件分析
    burp suite
    千万实例可观测采集器iLogtail
    grep 匹配多个关键字
    127.0.0.1和0.0.0.0
    Python 爬虫进阶必备 | 某常见 cookie 加密算法逻辑分析 (加速乐 jsl) https://mp.weixin.qq.com/s/fKuPs2b3MvOi8y4hPVbgNA
    百度商业大规模高性能全息日志检索技术揭秘
    ECB加密 CBC
  • 原文地址:https://www.cnblogs.com/star250/p/2013477.html
Copyright © 2011-2022 走看看