标签:
public static void SendToUIThread(UIElement element, string text) { element.Dispatcher.BeginInvoke( new Action(() => { SendKeys.SendWait(text); }), DispatcherPriority.Input ); } //后台调用 private void Key_Click(object sender, RoutedEventArgs e) { Button btn = (Button)sender; Model.VM_Key.SendToUIThread((UIElement)Keyboard.FocusedElement, btn.Content.ToString()); }
标签:
原文地址:http://www.cnblogs.com/zhaohaoran/p/5083259.html