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的更多相关文章

  1. CSS 3学习——animation动画

    以下内容根据官方文档翻译以及自己的理解整理. 1.  介绍 本方案介绍动画(animations).通过动画,开发者可以将CSS属性值的变化指定为一个随时间变化的关键帧(keyframes)的集合.在 ...

  2. 虾扯蛋:Android View动画 Animation不完全解析

    本文结合一些周知的概念和源码片段,对View动画的工作原理进行挖掘和分析.以下不是对源码一丝不苟的分析过程,只是以搞清楚Animation的执行过程.如何被周期性调用为目标粗略分析下相关方法的执行细节 ...

  3. 实现了一个百度首页的彩蛋——CSS3 Animation简介

    在百度搜索中有这样一个彩蛋:搜索“旋转”,“跳跃”,“反转”等词语,会出现相应的动画效果(搜索“反转”后的效果).查看源码可以发现,这些效果正是通过CSS3的animation属性实现的. 实现这个彩 ...

  4. 深入理解CSS3 Animation 帧动画

    CSS3我在5年之前就有用了,包括公司项目都一直在很前沿的技术. 最近在写慕课网的七夕主题,用了大量的CSS3动画,但是真的沉淀下来仔细的去深入CSS3动画的各个属性发现还是很深的,这里就写下关于帧动 ...

  5. Android动画效果之Property Animation进阶(属性动画)

    前言: 前面初步认识了Android的Property Animation(属性动画)Android动画效果之初识Property Animation(属性动画)(三),并且利用属性动画简单了补间动画 ...

  6. Android动画效果之初识Property Animation(属性动画)

    前言: 前面两篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画).Frame Animation(逐帧动画)Andr ...

  7. Android动画效果之Frame Animation(逐帧动画)

    前言: 上一篇介绍了Android的Tween Animation(补间动画) Android动画效果之Tween Animation(补间动画),今天来总结下Android的另外一种动画Frame ...

  8. Android动画效果之Tween Animation(补间动画)

    前言: 最近公司项目下个版本迭代里面设计了很多动画效果,在以往的项目中开发中也会经常用到动画,所以在公司下个版本迭代开始之前,抽空总结一下Android动画.今天主要总结Tween Animation ...

  9. 谈谈iOS Animation

    零.前言 这里没有太多的代码细节,只是探索iOS动画的基本概念,以及其抽象模型,数学基础等.我们学习一个知识的时候一般有两个部分,抽象部分和形象部分,抽象好比语言的语法,是规则,形象好比具体的句子,可 ...

  10. css3 transition animation nick

    时光转眼即逝,又到周六了,今天写点某部分人看不起的css玩玩! 转换 转换属性transform: 浏览器前缀: -webkit-transform;-o-transform;-moz-transfo ...

随机推荐

  1. 遇到慢查询怎么办?一文解读MySQL 8.0查询分析工具

    本文分享自华为云社区<[华为云MySQL技术专栏]MySQL 8.0 EXPLAIN ANALYZE 工具介绍>,作者:GaussDB 数据库. 1. EXPLAIN ANALYZE可以解 ...

  2. 题解: CF768D Jon and Orbs

    题解:CF768D Jon and Orbs 一句话题面:有k种不同的物品,每天等概率任取一种(不一定是新的种类).q组询问,每组给出一个p,问取完这k件物品的概率不小于\(\frac{p}{2000 ...

  3. 【转载】【深度学习服务器组装】【DIY土豪級別電腦】1.5TB記憶體192核心384線程雙路EPYC9654+RTX4090=神豪的量化+深度學習電腦

    视频地址: https://www.youtube.com/watch?v=_VMvGuVGI1M

  4. Codeforces 777 题目研讨

    题目连接 A B C D E 题目分析 A 难度:普及− 题面翻译: 给你三张牌:\(0\),\(1\),\(2\). 最初选一张,然后依次进行 \(n\) 次交换,交换规则为:中间一张和左边的一张, ...

  5. 基于RDK X5的智慧交通监控系统

    · 本Blogs同步发表至CSDN:https://blog.csdn.net/xiongqi123123/article/details/143840675?sharetype=blogdetail ...

  6. Mongodb的配置与登录

    1.下载完mongo后,把mongo的路径加入到用户与电脑的环境变量里面,如下图第二行. 2.新建一个文件夹,下面有db和log,两个文件夹,log里面新建一个mongodb.log文件,分别存放数据 ...

  7. The 2024 ICPC Asia East Continent Online Contest (I) C

    Link: Permutation Counting 4 我的评价是神题,给出两种做法. 方法一 利用线代技巧. 设法构造矩阵 \(A\), 其中 \(A_{ij} = [j \in [l_i, r_ ...

  8. 奥迪借助Karpenter为关键业务节省63%成本

    原文链接: https://aws.amazon.com/cn/solutions/case-studies/audi-efficient-compute-case-study/ 翻译:cloudpi ...

  9. Python基础:Python可变对象和不可变对象

    Python在heap中分配的对象分成两类:可变对象和不可变对象.所谓可变对象是指,对象的内容是可变的,例如list.而不可变的对象则相反,表示其内容不可变. 不可变对象:int,string,flo ...

  10. 编程辅助工具之Kite

    python作为一门门槛很低但又功能强大的编程语言,现在已经得到了非常广泛的使用,但是它的常用库非常多,而且往往更新后许多方法都有所变化,因此想要记住其大部分函数的用法对于大部分人来说比较困难,因而会 ...