Created
April 24, 2016 12:51
-
-
Save tmyt/3b6c5249f3ef398cf4d0253fcfbfd6fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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