In c# I'm trying to fade a Image
in then out in my application. Its a image in the MainPage
. At first it works great. But If I navigate to another site, lets say Settings.xaml
and then back to MainPage
the Dispatcher throws Invalid cross-thread access.
Anyone got an idea, this is how I'm trying to set the images opacity in my BackgroundWorker
's _DoWork
function:
Dispatcher.BeginInvoke(() =>
{
MyImage.Opacity = opacity;
});
Funny, it does not break, but put a breakpoint
on it and it says everything is Invalid cross-thread access.