【发布时间】:2018-02-11 15:16:30
【问题描述】:
我有错误,这是我的代码。
private void ComboBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
{
_comboBox.Dispatcher.InvokeAsync(() => ContentChanged?.Invoke(sender, EventArgs.Empty));
}
它说Dispatcher' does not contain a definition for 'InvokeAsync' and no extension method 'InvokeAsync' accepting a first argument of type 'Dispatcher' could be found (are you missing a using directive or an assembly reference? wpf 我迷路了,我需要这些帮助。谢谢。
【问题讨论】:
-
写成
_comboBox.Dispatcher.InvokeAsync((Action)(() => ContentChanged?.Invoke(sender, EventArgs.Empty))); -
@RandRandom 同样问题先生...
标签: c# .net wpf mvvm dispatcher