下面放一张效果图:

那么具体是怎么实现呢:

前端xaml中:

        <image source="/images/tips.png" horizontalalignment="left" width="25" height="25" mouseenter="image_mouseenter" mouseleave="image_mouseleave" ishittestvisible="false"/>
        <canvas  margin="0,20,0,0" horizontalalignment="left" x:name="tipsbqb" opacity="0">
            <image source="/images/bqb.jpg" height="200" width="200"/>
            <textblock  text="瞅咩啦靓仔" foreground="black" fontsize="40" margin="0,165,0,0" fontweight="bold" />
        </canvas>

讲一下前端xaml中的一些标签属性

mouseenter:鼠标焦点悬浮事件。

mouseleave:鼠标焦点悬浮离开事件。

ishittestvisible是否遮挡下层控件。(默认为true,也就是说下层的控件你点不到)

canvas:常用的ui布局标签。

opacity:透明度。

image:可以查看我的上一篇博客:https://www.cnblogs.com/stay627/p/12179045.html。

后台代码:

        private void image_mouseenter(object sender, mouseeventargs e)
        {
            //渐显
            doubleanimation dav = new doubleanimation(0, 1, new duration(timespan.fromseconds(0.5)));
            this.tipsbqb.beginanimation(uielement.opacityproperty, dav);
        }
        private void image_mouseleave(object sender, mouseeventargs e)
        {
            //渐隐
            doubleanimation dav = new doubleanimation(1, 0, new duration(timespan.fromseconds(0.5)));
            this.tipsbqb.beginanimation(uielement.opacityproperty, dav);
        }

doubleanimation对象:指定一个double类型的属性,使其在指定的时间内由起点值到达终点值,从而形成动画效果。(参数1:起始参数,参数2:结束参数,参数3:过程秒数)

beginanimation方法:执行动画效果。(参数1:控件属性元素,参数2:动画效果参数对象)。

然后我们就可以做许多骚操作了,比如保存后,全屏提示保存成功!(例如minecraft 1.8的全屏提示文字)