Win8系统的Loading效果还是很不错的,网上也有人用CSS3等技术实现,研究了一下,并打算用WPF自定义一个Loading控件实现类似的效果,并可以让用户对Loading的颗粒(Particle)背景颜色进行自定义,话不多说,直接上代码:

1、用VS2012新建一个WPF的用户控件库项目WpfControlLibraryDemo,VS自动生成如下结构:

2、删除UserControl1.xaml,并新建一个Loading的CustomControl(不是UserControl),如下图所示:

3、如果报错找不到Loading类型,请编译,下面在Generic.xaml主题文件中对Loading的样式和内容进行定义(注意添加 xmlns:system = "clr-namespace:System;assembly=mscorlib"),代码如下:

 <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system = "clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:WpfControlLibraryDemo"> <Style TargetType="{x:Type local:Loading}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Loading}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid Width = "50" Height = "50">
<Grid.Resources>
<!-- Value Converters --> <!-- Particle Styling ,must to has RelativeSource -->
<SolidColorBrush x:Key = "ParticleColor" Color = "{Binding Path=FillColor,RelativeSource={RelativeSource TemplatedParent}}" />
<SolidColorBrush x:Key = "ParticleBackgroundColor" Color = "Transparent"/>
<system:Double x:Key = "ParticleOpacity">1</system:Double>
<system:Double x:Key = "ParticleRadius">5</system:Double> <system:Double x:Key = "StartingPointX">0</system:Double>
<system:Double x:Key = "StartingPointY">-20</system:Double> <system:Double x:Key = "RotationPointX">0.5</system:Double>
<system:Double x:Key = "RotationPointY">0.5</system:Double> <!-- StoryBoard -->
<system:TimeSpan x:Key = "StoryBoardBeginTimeP0">00:00:00.000</system:TimeSpan>
<system:TimeSpan x:Key = "StoryBoardBeginTimeP1">00:00:00.100</system:TimeSpan>
<system:TimeSpan x:Key = "StoryBoardBeginTimeP2">00:00:00.200</system:TimeSpan>
<system:TimeSpan x:Key = "StoryBoardBeginTimeP3">00:00:00.300</system:TimeSpan>
<system:TimeSpan x:Key = "StoryBoardBeginTimeP4">00:00:00.400</system:TimeSpan>
<Duration x:Key = "StoryBoardDuration">00:00:01.800</Duration> <!-- Particle Origin Angles -->
<system:Double x:Key = "ParticleOriginAngleP0">0</system:Double>
<system:Double x:Key = "ParticleOriginAngleP1">-10</system:Double>
<system:Double x:Key = "ParticleOriginAngleP2">-20</system:Double>
<system:Double x:Key = "ParticleOriginAngleP3">-30</system:Double>
<system:Double x:Key = "ParticleOriginAngleP4">-40</system:Double> <!-- Particle Position & Timing 1 -->
<system:Double x:Key = "ParticleBeginAngle1">0</system:Double>
<system:Double x:Key = "ParticleEndAngle1">90</system:Double>
<system:TimeSpan x:Key = "ParticleBeginTime1">00:00:00.000</system:TimeSpan>
<Duration x:Key = "ParticleDuration1">00:00:00.750</Duration> <!-- Particle Position & Timing 2 -->
<system:Double x:Key = "ParticleBeginAngle2">90</system:Double>
<system:Double x:Key = "ParticleEndAngle2">270</system:Double>
<system:TimeSpan x:Key = "ParticleBeginTime2">00:00:00.751</system:TimeSpan>
<Duration x:Key = "ParticleDuration2">00:00:00.300</Duration> <!-- Particle Position & Timing 3 -->
<system:Double x:Key = "ParticleBeginAngle3">270</system:Double>
<system:Double x:Key = "ParticleEndAngle3">360</system:Double>
<system:TimeSpan x:Key = "ParticleBeginTime3">00:00:01.052</system:TimeSpan>
<Duration x:Key = "ParticleDuration3">00:00:00.750</Duration> <Style x:Key = "EllipseStyle" TargetType = "Ellipse">
<Setter Property = "Width" Value = "{StaticResource ParticleRadius}"/>
<Setter Property = "Height" Value = "{StaticResource ParticleRadius}"/>
<Setter Property = "Fill" Value = "{StaticResource ParticleColor}"/>
<Setter Property = "RenderTransformOrigin" Value = "0.5, 0.5"/>
<Setter Property = "Opacity" Value = "{StaticResource ParticleOpacity}"/>
</Style>
</Grid.Resources>
<Canvas Width = "1" Height = "1" Margin="0,0,0,0">
<Canvas.Triggers>
<EventTrigger RoutedEvent = "Canvas.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard BeginTime = "{StaticResource StoryBoardBeginTimeP0}"
Duration = "{StaticResource StoryBoardDuration}"
RepeatBehavior = "Forever">
<DoubleAnimation
Storyboard.TargetName = "p0"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle1}"
To = "{StaticResource ParticleEndAngle1}"
BeginTime = "{StaticResource ParticleBeginTime1}"
Duration = "{StaticResource ParticleDuration1}"/>
<DoubleAnimation
Storyboard.TargetName = "p0"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle2}"
To = "{StaticResource ParticleEndAngle2}"
BeginTime = "{StaticResource ParticleBeginTime2}"
Duration = "{StaticResource ParticleDuration2}"/>
<DoubleAnimation
Storyboard.TargetName = "p0"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle3}"
To = "{StaticResource ParticleEndAngle3}"
BeginTime = "{StaticResource ParticleBeginTime3}"
Duration = "{StaticResource ParticleDuration3}"/>
</Storyboard>
</BeginStoryboard>
<BeginStoryboard>
<Storyboard BeginTime = "{StaticResource StoryBoardBeginTimeP1}"
Duration = "{StaticResource StoryBoardDuration}"
RepeatBehavior = "Forever"> <DoubleAnimation
Storyboard.TargetName = "p1"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle1}"
To = "{StaticResource ParticleEndAngle1}"
BeginTime = "{StaticResource ParticleBeginTime1}"
Duration = "{StaticResource ParticleDuration1}"/>
<DoubleAnimation
Storyboard.TargetName = "p1"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle2}"
To = "{StaticResource ParticleEndAngle2}"
BeginTime = "{StaticResource ParticleBeginTime2}"
Duration = "{StaticResource ParticleDuration2}"/>
<DoubleAnimation
Storyboard.TargetName = "p1"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle3}"
To = "{StaticResource ParticleEndAngle3}"
BeginTime = "{StaticResource ParticleBeginTime3}"
Duration = "{StaticResource ParticleDuration3}"/>
</Storyboard>
</BeginStoryboard>
<BeginStoryboard>
<Storyboard BeginTime = "{StaticResource StoryBoardBeginTimeP2}"
Duration = "{StaticResource StoryBoardDuration}"
RepeatBehavior = "Forever"> <DoubleAnimation
Storyboard.TargetName = "p2"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle1}"
To = "{StaticResource ParticleEndAngle1}"
BeginTime = "{StaticResource ParticleBeginTime1}"
Duration = "{StaticResource ParticleDuration1}"/>
<DoubleAnimation
Storyboard.TargetName = "p2"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle2}"
To = "{StaticResource ParticleEndAngle2}"
BeginTime = "{StaticResource ParticleBeginTime2}"
Duration = "{StaticResource ParticleDuration2}"/>
<DoubleAnimation
Storyboard.TargetName = "p2"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle3}"
To = "{StaticResource ParticleEndAngle3}"
BeginTime = "{StaticResource ParticleBeginTime3}"
Duration = "{StaticResource ParticleDuration3}"/>
</Storyboard>
</BeginStoryboard> <BeginStoryboard>
<Storyboard BeginTime = "{StaticResource StoryBoardBeginTimeP3}"
Duration = "{StaticResource StoryBoardDuration}"
RepeatBehavior = "Forever"> <DoubleAnimation
Storyboard.TargetName = "p3"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle1}"
To = "{StaticResource ParticleEndAngle1}"
BeginTime = "{StaticResource ParticleBeginTime1}"
Duration = "{StaticResource ParticleDuration1}"/>
<DoubleAnimation
Storyboard.TargetName = "p3"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle2}"
To = "{StaticResource ParticleEndAngle2}"
BeginTime = "{StaticResource ParticleBeginTime2}"
Duration = "{StaticResource ParticleDuration2}"/>
<DoubleAnimation
Storyboard.TargetName = "p3"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle3}"
To = "{StaticResource ParticleEndAngle3}"
BeginTime = "{StaticResource ParticleBeginTime3}"
Duration = "{StaticResource ParticleDuration3}"/>
</Storyboard>
</BeginStoryboard> <BeginStoryboard>
<Storyboard BeginTime = "{StaticResource StoryBoardBeginTimeP4}"
Duration = "{StaticResource StoryBoardDuration}"
RepeatBehavior = "Forever"> <DoubleAnimation
Storyboard.TargetName = "p4"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle1}"
To = "{StaticResource ParticleEndAngle1}"
BeginTime = "{StaticResource ParticleBeginTime1}"
Duration = "{StaticResource ParticleDuration1}"/>
<DoubleAnimation
Storyboard.TargetName = "p4"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle2}"
To = "{StaticResource ParticleEndAngle2}"
BeginTime = "{StaticResource ParticleBeginTime2}"
Duration = "{StaticResource ParticleDuration2}"/>
<DoubleAnimation
Storyboard.TargetName = "p4"
Storyboard.TargetProperty = "(UIElement.RenderTransform).(RotateTransform.Angle)"
From = "{StaticResource ParticleBeginAngle3}"
To = "{StaticResource ParticleEndAngle3}"
BeginTime = "{StaticResource ParticleBeginTime3}"
Duration = "{StaticResource ParticleDuration3}"/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</Canvas.Triggers>
<Border
x:Name = "p0"
Background = "{StaticResource ParticleBackgroundColor}"
Opacity = "{StaticResource ParticleOpacity}">
<Border.RenderTransform>
<RotateTransform/>
</Border.RenderTransform>
<Border.RenderTransformOrigin>
<Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
</Border.RenderTransformOrigin>
<Ellipse Style = "{StaticResource EllipseStyle}">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
<RotateTransform Angle = "{StaticResource ParticleOriginAngleP0}"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
<Border
x:Name = "p1"
Background = "{StaticResource ParticleBackgroundColor}"
Opacity = "{StaticResource ParticleOpacity}">
<Border.RenderTransform>
<RotateTransform/>
</Border.RenderTransform>
<Border.RenderTransformOrigin>
<Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
</Border.RenderTransformOrigin>
<Ellipse Style = "{StaticResource EllipseStyle}">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
<RotateTransform Angle = "{StaticResource ParticleOriginAngleP1}"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
<Border
x:Name = "p2"
Background = "{StaticResource ParticleBackgroundColor}"
Opacity = "{StaticResource ParticleOpacity}">
<Border.RenderTransform>
<RotateTransform/>
</Border.RenderTransform>
<Border.RenderTransformOrigin>
<Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
</Border.RenderTransformOrigin>
<Ellipse Style = "{StaticResource EllipseStyle}">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
<RotateTransform Angle = "{StaticResource ParticleOriginAngleP2}"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
<Border
x:Name = "p3"
Background = "{StaticResource ParticleBackgroundColor}"
Opacity = "{StaticResource ParticleOpacity}">
<Border.RenderTransform>
<RotateTransform/>
</Border.RenderTransform>
<Border.RenderTransformOrigin>
<Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
</Border.RenderTransformOrigin>
<Ellipse Style = "{StaticResource EllipseStyle}">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
<RotateTransform Angle = "{StaticResource ParticleOriginAngleP3}"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
<Border
x:Name = "p4"
Background = "{StaticResource ParticleBackgroundColor}"
Opacity = "{StaticResource ParticleOpacity}">
<Border.RenderTransform>
<RotateTransform/>
</Border.RenderTransform>
<Border.RenderTransformOrigin>
<Point X = "{StaticResource RotationPointX}" Y = "{StaticResource RotationPointY}"/>
</Border.RenderTransformOrigin>
<Ellipse Style = "{StaticResource EllipseStyle}">
<Ellipse.RenderTransform>
<TransformGroup>
<TranslateTransform X = "{StaticResource StartingPointX}" Y = "{StaticResource StartingPointY}"/>
<RotateTransform Angle = "{StaticResource ParticleOriginAngleP4}"/>
</TransformGroup>
</Ellipse.RenderTransform>
</Ellipse>
</Border>
</Canvas>
</Grid> </Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style> </ResourceDictionary>

在构建中发现,一开始在设定绑定时,写成<SolidColorBrush x:Key = "ParticleColor" Color = "{Binding Path=FillColor}" />一直都无法绑定成功,后来查了资料,改成<SolidColorBrush x:Key = "ParticleColor" Color = "{Binding Path=FillColor,RelativeSource={RelativeSource TemplatedParent}}" /> 后成功。

4、编辑Loading.cs文件,对自定义属性FillColor和逻辑进行编码:

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes; namespace WpfControlLibraryDemo
{
using System.ComponentModel;
/// <summary>
/// 按照步骤 1a 或 1b 操作,然后执行步骤 2 以在 XAML 文件中使用此自定义控件。
///
/// 步骤 1a) 在当前项目中存在的 XAML 文件中使用该自定义控件。
/// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根
/// 元素中:
///
/// xmlns:MyNamespace="clr-namespace:WpfControlLibraryDemo"
///
///
/// 步骤 1b) 在其他项目中存在的 XAML 文件中使用该自定义控件。
/// 将此 XmlNamespace 特性添加到要使用该特性的标记文件的根
/// 元素中:
///
/// xmlns:MyNamespace="clr-namespace:WpfControlLibraryDemo;assembly=WpfControlLibraryDemo"
///
/// 您还需要添加一个从 XAML 文件所在的项目到此项目的项目引用,
/// 并重新生成以避免编译错误:
///
/// 在解决方案资源管理器中右击目标项目,然后依次单击
/// “添加引用”->“项目”->[浏览查找并选择此项目]
///
///
/// 步骤 2)
/// 继续操作并在 XAML 文件中使用控件。
///
/// <MyNamespace:Loading/>
///
/// </summary>
public class Loading : Control
{
static Loading()
{
//重载默认样式
DefaultStyleKeyProperty.OverrideMetadata(typeof(Loading), new FrameworkPropertyMetadata(typeof(Loading)));
//DependencyProperty 注册 FillColor
FillColorProperty = DependencyProperty.Register("FillColor",
typeof(Color),
typeof(Loading),
new UIPropertyMetadata(Colors.DarkBlue,
new PropertyChangedCallback(OnUriChanged))
);
//Colors.DarkBlue为控件初始化默认值 }
//属性变更回调函数
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
//Border b = (Border)d;
//MessageBox.Show(e.NewValue.ToString()); }
#region 自定义Fields
// DependencyProperty属性定义 FillColorProperty=FillColor+Property组成
public static readonly DependencyProperty FillColorProperty;
#endregion
//VS设计器属性支持
[Description("背景色"), Category("个性配置"), DefaultValue("#FF668899")]
public Color FillColor
{
//GetValue,SetValue为固定写法,此处一般不建议处理其他逻辑
get { return (Color)GetValue(FillColorProperty); }
set { SetValue(FillColorProperty, value); }
}
}
}

5、编译,如果无误后,可以添加WPF应用程序WpfAppLoadingTest进行测试(添加项目引用)。

打开MainWindow.xaml,将Loading控件拖放到设计界面上,如下图所示:

6、控件颜色修改,选中控件,在属性栏中进行配置即可:

7.总结

可以看到WPF自定义控件还是比较容易的,但是难点在于UI的设计,如果需要做的美观,需要美工的参与,而且需要转换成XAML。

WPF实现炫酷Loading控件的更多相关文章

  1. WPF自定义控件(一)の控件分类

    一.什么是控件(Controls) 控件是指对数据和方法的封装.控件可以有自己的属性和方法,其中属性是控件数据的简单访问者,方法则是控件的一些简单而可见的功能.控件创建过程包括设计.开发.调试(就是所 ...

  2. 基于 WPF 平台的 ActiveReports Viewer控件

    ActiveReports 报表控件致力于为组织和个人提供最出色的报表解决方案,多年来ActiveReports已经提供了 Windows Forms.Web.Silverlight和Flash平台的 ...

  3. winform 自定义控件:半透明Loading控件

    winform  自定义控件:半透明Loading控件 by wgscd date:2015-05-05 效果: using System;using System.Drawing;using Sys ...

  4. WPF不同线程之间的控件的访问

    原文:WPF不同线程之间的控件的访问 WPF不同线程之间的控件是不同访问的,为了能够访问其他线程之间的控件,需要用Dispatcher.Invoke执行一个新的活动即可. 例如: public voi ...

  5. WindowsXamlHost:在 WPF 中使用 UWP 的控件(Windows Community Toolkit)

    Windows Community Toolkit 再次更新到 5.0.以前可以在 WPF 中使用有限的 UWP 控件,而现在有了 WindowsXamlHost,则可以使用更多 UWP 原生控件了. ...

  6. WPF 动画:同为控件不同命 - 简书

    原文:WPF 动画:同为控件不同命 - 简书 1. 及格与优秀 读大学的时候,有一门课的作业是用 PPT 展示. 但是我们很多同学都把 PPT 当做 Word 来用,就单纯地往里面堆文字. 大家都单纯 ...

  7. WPF 支持集合绑定的控件

    WPF 支持集合绑定的控件 ListBox ComboBox ListView DataGrid

  8. 一款炫酷Loading动画--载入失败

    简单介绍 上一篇文章一款炫酷Loading动画–载入成功.给大家介绍了成功动画的绘制过程,这篇文章将接着介绍载入失败特效的制作. 相比成功动画,有了前面的经验,失败动画的过程就显得比較简单了. 动画结 ...

  9. WPF 使用鼠标拖动一个控件的实现[2018.7.15]

    原文:WPF 使用鼠标拖动一个控件的实现[2018.7.15] Q:已经把一个Shape和一个TextBlock组合起来放到了一个Grid中,现在想要实现用鼠标拖动这个Grid到任意位置的功能,如何做 ...

随机推荐

  1. ssh(sturts2_spring_hibernate) 框架搭建之spring

    一.spring总结: ⑴.spring是一个轻量级的JAVA开发框架,主要的作用是用来管理实例(可以解决JAVA类中new对象的问题,节省内存资源.)和降低代码之间的耦合性,促进代码模块化. ⑵.促 ...

  2. Archlinux 2015.07.01 和 Windows7 双系统 安装教程

    提前在windows7下给Archlinux预留一个分区,大小最好在20G以上(根据自己硬盘情况分配). 第一步,安装前的准备 从arch官网下载最新的ISO文件archlinux-2015.07.0 ...

  3. Topology and Geometry in OpenCascade-Vertex

    Topology and Geometry in OpenCascade-Vertex eryar@163.com 摘要Abstract:本文简要介绍了几何造型中的边界表示法(BRep),并结合程序说 ...

  4. js中关于value的一个小知识点(value既是属性也是变量)

    今天在学习input的value值时,发现这么一个小知识点,以前理解不太透彻. [1]以下这种情况是常见情况,会弹出“测试内容” <input type="button" v ...

  5. 【原创】C#玩高频数字彩快3的一点体会

    购彩风险非常高,本人纯属很久以前对数字高频彩的一点研究.目前已经远离数字彩,重点研究足球篮球比赛资料库和赛果预测. 这是一篇在草稿箱保存了1年多的文章,一直没发现,顺便修改修改分享给大家.以后会有更多 ...

  6. 解决gradle /Users/xxxx/Documents/workspace/fontmanager/.gradle/2.2.1/taskArtifacts/cache.properties (No such file or directory)报错办法

    git 上down下项目后,发现Android Studio报错: What went wrong: java.io.FileNotFoundException: /Users/raomengyang ...

  7. Eclipse快捷键大全(转载)

    一.实用类快捷键 1 常用熟悉的快捷键 CTRL+C(复制).CTRL+X(剪切).CTRL+Z(撤销).CTRL+F(查找).CTRL+H(搜索文件或字符串).CTRL+Y(重做).CTRL+/(双 ...

  8. 25套用于 Web UI 设计的免费 PSD 网页元素模板

    Web 元素是任何网站相关项目都需要的,质量和良好设计的元素对于设计师来说就像宝贝一样.如果您正在为您的网站,博客,Web 应用程序或移动应用程序寻找完美设计的网页元素,那么下面这个列表会是你需要的. ...

  9. H5新特性websocket

    websocket也是html5的新增加内容之一,号称是下一代客户端/服务器异步通信办法,私以为虽然有点吹牛的成分,但是以后说不定能成为异步通信的半壁江山,至于取代ajax,我觉的应该不会. webs ...

  10. Lambda表达式演变

    Lambda表达式是一种匿名函数.   演变步骤:   一般的方法委托 => 匿名函数委托 => Lambda表达式   Lambda表达式其实并不陌生,他的前生就是匿名函数,所以要谈La ...