I have a button for which I receive a click command via bluetooth, and this happens on a different thread:
//Auto click record button
if (action_type_received_final == 0)
{
ButtonAutomationPeer peer2 = new ButtonAutomationPeer(Btn_Record);
IInvokeProvider invokeProv2 = peer2.GetPattern(PatternInterface.Invoke) as IInvokeProvider;
//invokeProv2.Invoke();
Dispatcher.Invoke(new ThreadStart(() => invokeProv2.Invoke()));
action_type_received_final = 0;
}
The code runs fine, but nothing happens on the UI. I understand that I have to come back to the UI thread somehow, but I just don't know how. I would appreciate any help.