Anyone knows how to return a value from Dispatcher
.Invoke
in wpf? I want to return the selected index for a ComboBox.
Thanks!
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.