基本クラスでは非同期ではないが、派生クラスでは非同期である仮想メソッドを定義したいのですが、呼び出し元はデリゲート(実際には画面上のボタンによってアクティブ化されるICommand)を使用してそれを呼び出します。これを行うにはどうすればよいですか。
public class BaseClass
{
BIONESSBindingCommand mLogoffCommand;
public ICommand LogoffCommand
{
get
{
if (mLogoffCommand == null)
{
mLogoffCommand = new BIONESSBindingCommand(
Param => Logoff(), //Command DoWork
Param => true); //Always can execute
}
return mLogoffCommand;
}
}
public virtual Task Logoff()
{
DoLogoff();
return null; //???
}
}
public class DerivedClass : BaseClass
{
public override async Task Logoff()
{
await SomeWoAsyncWork();
base.Logoff(); //Has warninngs
}
}