我有这个方法
public async void setState(int state)
{
switch (state)
{
default:
await this.ShowMessageAsync("Title", "Message");
break;
}
}
我是从 MetroWindow 的管理员那里调用的。但我得到这个错误:
An exception of type 'System.NullReferenceException' occurred in MahApps.Metro.dll but was not handled in user code
Additional information: Object reference not set to an instance of an object.
在线上
await this.ShowMessageAsync("Title", "Message");
我该如何解决?