稳扎稳打Silverlight
示例
1、IMarkupExtension(自定义 XAML 扩展标记)
XAML/ConcatMarkupExtension.cs
using System;using System.Collections.Generic;using System.Linq;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using System.Windows.Navigation;namespace Silverlight50.Other{ public partial class ClickCount : Page { public ClickCount() { InitializeComponent(); } protected override void OnNavigatedTo(NavigationEventArgs e) { } private void rectangle_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { /* * MouseButtonEventArgs.ClickCount - 获取连击的次数 * 注:连击的最大间隔时间是由操作系统的"控制面板"-->"鼠标"-->"双击速度"设置的 */ if (e.ClickCount == 1) // Single Click txt.Text = "Left Mouse Click Counter:" + e.ClickCount.ToString(); else if (e.ClickCount == 2) // Double Click txt.Text = "Left Mouse Click Counter:" + e.ClickCount.ToString(); else // More Click txt.Text = "Left Mouse Click Counter:" + e.ClickCount.ToString(); } }}