How to return a value with Dispatcher.Invoke?

There’s another way that returns value from Invoke():

object oIsLoaded = container.Dispatcher.Invoke( new Func<bool> ( () =>
    {
        return container.IsLoaded;
    })
);

And by the way, chances are that the initial code (which is working with delegate) won’t modify oIsLoaded at all; So I’d rather use a Func<> for returning a value from that kind of function.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)