Here is small code to trigger button’s Click event using automation peer from source code :
if (button is Button)
{
ButtonAutomationPeer peer = new ButtonAutomationPeer((Button)button);
IInvokeProvider ip = (IInvokeProvider)peer;
ip.Invoke();
}
Trick will be used in upcoming article “Smart shortcut keys” for adding accessibility to silverlight applications.