手机wp的 触摸事件和 mouse 事件

   <TextBlock Text="Hello, Windows Phone 7!"   MouseLeftButtonDown="TextBlock_MouseLeftButtonDown"
                       Padding="0 22"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Center"
                       ManipulationStarted="OnTextBlockManipulationStarted" />

 void OnTextBlockManipulationStarted(object sender,
                                            ManipulationStartedEventArgs args)
        {
            TextBlock txtblk = sender as TextBlock;

            Color clr = Color.FromArgb(255, (byte)rand.Next(256),
                                            (byte)rand.Next(256),
                                            (byte)rand.Next(256));

            txtblk.Foreground = new SolidColorBrush(clr);

            args.Complete();
        }

        private void TextBlock_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {

        }

在模拟器上 manipulationstarted 和 mouseleftbuttondown 都能触发,

在手机上应该也是

posted on 2012-05-28 16:36  GIS-MAN  阅读(548)  评论(0编辑  收藏  举报

导航