Skip to content

Instantly share code, notes, and snippets.

@tmyt
Created April 24, 2016 12:51
Show Gist options
  • Save tmyt/3b6c5249f3ef398cf4d0253fcfbfd6fe to your computer and use it in GitHub Desktop.
Save tmyt/3b6c5249f3ef398cf4d0253fcfbfd6fe to your computer and use it in GitHub Desktop.
using Windows.UI.Xaml.Automation.Peers;
using Windows.UI.Xaml.Automation.Provider;
using Windows.UI.Xaml.Controls;
namespace Tetraptera.Common.Extensions
{
public static class ButtonExtension
{
public static void RaiseClick(this Button button)
{
var peer = new ButtonAutomationPeer(button);
var invokeProv = peer.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
invokeProv.Invoke();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment