zoukankan      html  css  js  c++  java
  • WPF为提示信息文本增加闪烁效果

    程序通常需要显示某些提醒用户警示的信息,如:收件箱(40)其中数量闪烁就会起到警示效果。可以适用如下Storyboard实现:

    <ItemsControl.ItemTemplate>
    <DataTemplate>
        <Button Command="{x:Static local:QueryRecordItem.OpenCommand}" FocusVisualStyle="{x:Null}" Focusable="False"
                ContextMenu="{StaticResource ShellContextMenu}" ToolTip="{Binding ToolTip}">
            <StackPanel Orientation="Horizontal">
                <TextBlock Text="{Binding Description}"/>
                <TextBlock Text="{Binding TipText}" Foreground="Red" Visibility="{Binding Converter={x:Static jsm:Converters.BooleanToVisibility}, Path=HasItem, ConverterParameter=true}"/>
                <Border Background="Red" CornerRadius="5" Visibility="{Binding Converter={x:Static jsm:Converters.BooleanToVisibility}, Path=HasItem}">
                    <Border.Triggers>
                        <EventTrigger RoutedEvent="Loaded">
                            <BeginStoryboard>
                                <Storyboard BeginTime="0:0:0" AutoReverse="True" RepeatBehavior="Forever">
                                    <ColorAnimation From="Red" To="Navy" RepeatBehavior="Forever" Storyboard.TargetProperty="Background.Color">
                                    </ColorAnimation>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </Border.Triggers>
                    <TextBlock Text="{Binding TipText}" Foreground="White"/>
                </Border>
            </StackPanel>
        </Button>
    </DataTemplate>
    </ItemsControl.ItemTemplate>
  • 相关阅读:
    C++二叉树
    C++、、
    C++符号优先级
    django 时间格式(全局修改,不用过滤器)
    华硕ASUS U5800GE驱动
    pycharm 代码跟进以跳回/返回
    linux多jdk切换环境
    celery timeout的拦截
    chrome开启headless模式以及代理
    python 单引号与双引号的转义
  • 原文地址:https://www.cnblogs.com/chriskwok/p/3836216.html
Copyright © 2011-2022 走看看