制作简单的WPF时钟
原文: 制作简单的WPF时钟 在很早之前,我曾经写过一个GDI+的时钟,见“C#时钟控件 (C# Clock Control)”http://blog.csdn.net/johnsuna/archive/2006/02/13/597746.aspx及“使用C#编写LED样式时钟控件”(http://blog.csdn.net/johnsuna/archive/2006/02/14/598867.aspx),进入WPF时代了,如何用WPF绘制一个时钟呢? 先看效果: 上面显示的是时间值,下面是图形版的时钟。 制作要点:1. 首先在Expression Blend中画出时钟的样式;2. 建立时钟的程序辅助类;3. 将此时钟样式需要动态换掉的部分改成相应的绑定值。 由于具体步骤很多,这里只说说技术难点和要点,着重说明上述第2点部分。// 时钟控件类:Clock.csusing System;using System.Windows;using System.Windows.Controls;using System.Windows.Controls.Primitives;using Syst...