CustomMessageBox
左ボタンのクリックが無効になったときに非同期メソッドを呼び出しています。しかし、それは私にコンプライアンスタイムエラーを与えます。私はそれをグーグルで検索しましたが、 MessageDialog.Commandに関するいくつかの情報を取得します。Windows phone で同じことを達成する方法CustomMessageBox
。
これが私のコードです
CustomMessageBox customMBox = new CustomMessageBox()
{
Caption = "Alert!",
Message = string.Format("Clicking on clear all will clear all the data on the app. Are you sure you want to proceed?"),
LeftButtonContent = "Yes",
RightButtonContent = "No",
};
customMBox.Dismissed += (s2, e2) =>
{
switch (e2.Result)
{
case CustomMessageBoxResult.LeftButton:
await clearDatabaseAsync();
break;
case CustomMessageBoxResult.RightButton:
break;
case CustomMessageBoxResult.None:
break;
default:
break;
}
};
customMBox.Show();
public async Task clearDatabaseAsync()
{
//SQLite clear table record logic
await App.DeleteDatabase();
}
どうすればこれを達成できるか教えてください。
前もって感謝します。