开发者

Dispatcher.CurrentDispatcher?

If I do this...

public PriorityQueue(Dispatcher dispatcher = null)
{
    this.dispatcher = dispatcher ?? Dispatcher.CurrentDispatcher;
}

And then use it in a ViewModel (without passing any args) that is created t开发者_Go百科hrough the XAML, this.dispatcher will point to the UI thread right?


If it is created from within the UI thread (which it would be, if instantiated inside XAML), then yes, it will point to the UI thread's Dispatcher.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜