"System.Windows.Input.mouseButtonEventArgs"不包含"Source"的定义
grt 2009-02-16 05:34:18 using System;
using System.Collections.Generic;
using System.Linq;
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.Controls.Primitives;
void Child_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.Source is TextBlock)
{
string str = ((TextBlock)e.Source).Text;
if (menucommand != null)
{
menucommand(str, null);
}
}
else if (e.Source is Rectangle)
{
string str = string.Empty;
foreach (FrameworkElement em in ((Grid)((Rectangle)e.Source).Parent).Children)
{
if (em is TextBlock)
{
str = ((TextBlock)em).Text;
}
}
if (menucommand != null)
{
menucommand(str, null);
}
}
PopUp.IsOpen = false;
}///////////////////////////////////////////////////////////////////
出错:
"System.Windows.Input.mouseButtonEventArgs"不包含"Source"的定义
应该怎么处理?