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.
精彩评论