在我的應用程序中,我使用彈出式菜單創建了自定義消息框(使用不同的背景色)。它有一個按鈕,我已經實現了按鈕點擊事件。Windows phone7彈出式自定義消息框
隨着按鈕點擊,它有一個消息框,並根據「確定」或「取消」它從那裏執行操作。
問題是我點擊彈出式窗口(自定義消息箱)中的按鈕後,消息框加載,但彈出窗口(自定義消息框)仍出現在背景中。我需要自定義彈出窗口完全關閉並執行操作。因此,我已經使用popup.IsOpen = false;
作爲按鈕點擊中的第一條語句,但它仍然出現在背景中,直到它完成整個按鈕單擊事件。我搜索了其他屬性,但沒有找到任何工作。
以下是代碼
Popup popup = new Popup();
popup.Height = 300;
popup.Width = 480;
popup.VerticalOffset = 100;
CustomMessageBox control = new CustomMessageBox();
popup.Child = control;
popup.IsOpen = true;
this.IsEnabled = false;
control.OK_BTN.Click += (s, args) =>
{
popup.IsOpen = false;
this.IsEnabled = true;
MessageBoxResult result = MessageBox.Show("Do you want to reset the settings ?", "Settings", MessageBoxButton.OKCancel);
if (result == MessageBoxResult.OK)
{
changeSettings();
}
};
任何建議來實現,這是高度讚賞。謝謝...!!!
好極了......它確實是我想要的。非常感謝你... – JibW 2012-08-07 08:21:21
取消button_click實現將分開做,我不會使用這個邏輯....所以它工作正常。大... – JibW 2012-08-07 09:07:02