c# WindowsCommunityToolkit--- Shade Animation
WindowsCommunityToolkit:
https://github.com/CommunityToolkit/WindowsCommunityToolkit
You can also preview the capabilities of the toolkit by downloading the Windows Community Toolkit Sample App in the Windows Store.
Feel free to browse the documentation using the table of contents on the left side of this page.
Open Source
Windows Community Toolkit Source Code
Shade Animation code sample:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
xmlns:media="using:Microsoft.Toolkit.Uwp.UI.Media"
xmlns:interactivity="using:Microsoft.Xaml.Interactivity"
xmlns:interactions="using:Microsoft.Xaml.Interactions.Core"
xmlns:ani="using:Microsoft.Toolkit.Uwp.UI.Animations"
xmlns:behaviors="using:Microsoft.Toolkit.Uwp.UI.Behaviors"
mc:Ignorable="d"> <Page.Resources>
<media:AttachedCardShadow x:Key="CommonShadow" Offset="4" CornerRadius="0"/> <ani:AnimationSet x:Key="ShadowEnterAnimation">
<ani:OffsetDropShadowAnimation To="12"/>
</ani:AnimationSet> <ani:AnimationSet x:Key="ShadowExitAnimation">
<ani:OffsetDropShadowAnimation To="5"/>
</ani:AnimationSet> <ani:AnimationSet x:Key="ShadowPopAnimation" IsSequential="True">
<ani:TranslationAnimation To="-8" Duration="0:0:1"/>
<ani:OffsetDropShadowAnimation To="16" Duration="0:0:2" Target="{StaticResource CommonShadow}"/>
<ani:OffsetDropShadowAnimation To="4" Delay="0:0:0.5" Duration="0:0:2" Target="{StaticResource CommonShadow}"/>
<ani:TranslationAnimation To="0" Duration="0:0:1"/>
</ani:AnimationSet>
</Page.Resources> <Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Image ui:Effects.Shadow="{StaticResource CommonShadow}"
Height="100" Width="100"
Source="ms-appx:///Assets/Photos/Owl.jpg">
<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="PointerEntered">
<behaviors:StartAnimationAction Animation="{StaticResource ShadowEnterAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="PointerExited">
<behaviors:StartAnimationAction Animation="{StaticResource ShadowExitAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Image>
<Image ui:Effects.Shadow="{StaticResource CommonShadow}"
Height="200" Width="200"
Grid.Column="1"
Source="ms-appx:///Assets/Photos/Owl.jpg">
<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="PointerEntered">
<behaviors:StartAnimationAction Animation="{StaticResource ShadowEnterAnimation}"/>
</interactions:EventTriggerBehavior>
<interactions:EventTriggerBehavior EventName="PointerExited">
<behaviors:StartAnimationAction Animation="{StaticResource ShadowExitAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Image>
<Button Grid.Row="1" Grid.ColumnSpan="2" HorizontalAlignment="Center" VerticalAlignment="Top" Content="Click Me">
<interactivity:Interaction.Behaviors>
<interactions:EventTriggerBehavior EventName="Click">
<behaviors:StartAnimationAction Animation="{StaticResource ShadowPopAnimation}"/>
</interactions:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</Button>
</Grid>
</Page>
很多效果控件,
如自定义title:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="using:Microsoft.Toolkit.Uwp.SampleApp.SamplePages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="using:Microsoft.Toolkit.Uwp.UI"
ui:ApplicationViewExtensions.Title="View Extensions"
ui:TitleBarExtensions.BackgroundColor="CornflowerBlue"
ui:TitleBarExtensions.ForegroundColor="White"
ui:TitleBarExtensions.ButtonBackgroundColor="CornflowerBlue"
ui:TitleBarExtensions.ButtonForegroundColor="White"
mc:Ignorable="d"> <Grid>
<TextBlock Margin="16" Text="Modify the XAML to change the Title."/>
</Grid>
</Page>
c# WindowsCommunityToolkit--- Shade Animation的更多相关文章
- CSS 3学习——animation动画
以下内容根据官方文档翻译以及自己的理解整理. 1. 介绍 本方案介绍动画(animations).通过动画,开发者可以将CSS属性值的变化指定为一个随时间变化的关键帧(keyframes)的集合.在 ...
- 虾扯蛋:Android View动画 Animation不完全解析
本文结合一些周知的概念和源码片段,对View动画的工作原理进行挖掘和分析.以下不是对源码一丝不苟的分析过程,只是以搞清楚Animation的执行过程.如何被周期性调用为目标粗略分析下相关方法的执行细节 ...
- 实现了一个百度首页的彩蛋——CSS3 Animation简介
在百度搜索中有这样一个彩蛋:搜索“旋转”,“跳跃”,“反转”等词语,会出现相应的动画效果(搜索“反转”后的效果).查看源码可以发现,这些效果正是通过CSS3的animation属性实现的. 实现这个彩 ...
- 深入理解CSS3 Animation 帧动画
CSS3我在5年之前就有用了,包括公司项目都一直在很前沿的技术. 最近在写慕课网的七夕主题,用了大量的CSS3动画,但是真的沉淀下来仔细的去深入CSS3动画的各个属性发现还是很深的,这里就写下关于帧动 ...
- Android动画效果之Property Animation进阶(属性动画)
前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...
- Android动画效果之初识Property Animation(属性动画)
前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...
- Android动画效果之Frame Animation(逐帧动画)
前言: 上一篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画),今天来总结下Android的另外一种动画Frame ...
- Android动画效果之Tween Animation(补间动画)
前言: 最近公司项目下个版本迭代里面设计了很多动画效果,在以往的项目中开发中也会经常用到动画,所以在公司下个版本迭代开始之前,抽空总结一下Android动画.今天主要总结Tween Animation ...
- 谈谈iOS Animation
零.前言 这里没有太多的代码细节,只是探索iOS动画的基本概念,以及其抽象模型,数学基础等.我们学习一个知识的时候一般有两个部分,抽象部分和形象部分,抽象好比语言的语法,是规则,形象好比具体的句子,可 ...
- css3 transition animation nick
时光转眼即逝,又到周六了,今天写点某部分人看不起的css玩玩! 转换 转换属性transform: 浏览器前缀: -webkit-transform;-o-transform;-moz-transfo ...
随机推荐
- [网鼎杯 2020 朱雀组]phpweb
打开靶机,抓包分析,获得连个关键参数func和p,根据初始页面提示了解连个参数大概是功能和功能参数 测试func=system&p=ls提示hacker..说明有检测过滤 那么我们先读取源码看 ...
- 4.3 Linux压缩文件或目录为.zip格式(zip命令)
我们经常会在 Windows 系统上使用 ".zip"格式压缩文件,其实".zip"格式文件是 Windows 和 Linux 系统都通用的压缩文件类型,属于几 ...
- 2024 xp_CAPTCHA(瞎跑-白嫖版) 4.3最新版安装使用教程
前言 xp_CAPTCHA(瞎跑-白嫖版)是一个免费的burpsuite插件,具有自动化图形验证码识别的功能.在安装的过程中,我发现网上的教程基本都为其较早的版本,已经不具备参考价值.因而我写下本篇博 ...
- debian大便系统配置国内软件源
本例在debian:buster-slim docker镜像中实验通过 1.启动docker实例 docker run -it --name debian debian:buster-slim bas ...
- win10子系统docker搭建gitlab Server
心血来潮想搞一套cicd玩玩,结果开始就掉坑里了. 遇到问题 不会写文,所以语言组织比较差,将就看着吧!就当记录一下这个坑以后没准还能用的上. 参照https://blog.csdn.net/Mono ...
- requests发送http请求、https请求
requests是一个python的第三方库,用来发送http请求,也可以发送https请求 发送http请求时不需要ssl证书: url="http://xxxxx.com" r ...
- 国产数据库oceanBbase,达梦,金仓与mysql数据库的性能对比 四、python读mysql写入达梦数据库
一.说明 安装达梦的驱动 pip install dmPython==2.5.5 参数接收那里,其他数据库都是用%,达梦要用? 二.源码 #coding=utf-8 import pymysql im ...
- 19、解析2_1(链、chunk、锁)
解析 shared pool 图解: library cache里面,暂时可以认为存储着: 1.SQL以及对应的执行计划(所占空间比较小): 2.存储过程.函数.触发器.包,它们编译后的对象(所占空间 ...
- 2024-11-27:字符串的分数。用go语言,给定一个字符串 s,我们可以定义其“分数”为相邻字符的 ASCII 码差值绝对值的总和。 请计算并返回字符串 s 的分数。 输入:s = “hello“
2024-11-27:字符串的分数.用go语言,给定一个字符串 s,我们可以定义其"分数"为相邻字符的 ASCII 码差值绝对值的总和. 请计算并返回字符串 s 的分数. 输入:s ...
- Rider离线使用Nuget包的方法
有时候,我们的开发环境可能没有网络,vs也不太好安装. 这时候我们就可以使用Rider.但是没有Nuget的话,很多东西用起来很复杂. 所以这里介绍一下Rider离线配置Nuget的方法. 从Nuge ...