If you still want to do that. You can now upgrade to Silverlight version 3.0 or later versions and do the following:
You can use the button automation peer from System.Windows.Automation.Peers to accomplish what you want.
if (button is Button)
{
ButtonAutomationPeer peer = new ButtonAutomationPeer((Button)button);
IInvokeProvider ip = (IInvokeProvider)peer;
ip.Invoke();
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…