If you're running from the UI thread, then the following method would be the most generic one, and will work both in WPF and in WinForms:
SynchronizationContext.Current.Send(_ =>
{
//anything you wish.
}, null);
Both the WinForms dispatcher and the WPF dispatcher are implementation of the SynchronizationContext that enqueue the requested action into the UI thread queue. This way you don't use anything specific.
If you're running your code outside the UI thread, then the SynchronizationContext.Current will reference to the "default" implementation which isn't what you're looking for (it doesn't run the actions inside the UI thread, but just in the ThreadPool). So, in that case if you have a reference to any UI control you can use the BeginInvoke method of anything that inherits from the Control
class.
Hope this helps.