如果IsDownloaded为True,则此代码将不会继续。如果False和Return,我如何正确地弹出MessageBox?如果我拿出'回归'即使IsDownloaded为True,也不会发生RingToneTask。
private void ExecuteSaveSoundAsRingtone(string soundPath)
{
if (IsDownloaded == false)
MessageBox.Show("Will not download until you short press atleast once");
return;
App.Current.RootVisual.Dispatcher.BeginInvoke(() =>
{
SaveRingtoneTask task = new SaveRingtoneTask();
task.Source = new Uri("isostore:/" + this.SavePath);
task.DisplayName = this.Title;
task.Show();
}
);
答案 0 :(得分:0)
使用范围
private void ExecuteSaveSoundAsRingtone(string soundPath)
{
if (IsDownloaded == false)
{
MessageBox.Show("Will not download until you short press atleast once");
return;
}
App.Current.RootVisual.Dispatcher.BeginInvoke(() =>
{
SaveRingtoneTask task = new SaveRingtoneTask();
task.Source = new Uri("isostore:/" + this.SavePath);
task.DisplayName = this.Title;
task.Show();
}
);