なので BackgroundWorker で DataContext を取得したい場合、こんな風に UI スレッドで動かしてやらないといけない。
Action action = () =>
{
var hoge = (HogeViewModel)this.DataContext;
// do something ...
}
tihs.Dispatcher.Invoke(action);
Action action = () =>
{
var hoge = (HogeViewModel)this.DataContext;
// do something ...
}
tihs.Dispatcher.Invoke(action);