在窗口電話7.5。我想在消息框中使用yes no按鈕。但是在消息框中沒有選項是沒有按鈕。我如何使用是的沒有按鈕或其他替代品顯示標題(OK =是和取消=否) 請幫助我。在windows phone 7.5中的消息框yesnoButtons
在此先感謝。
在窗口電話7.5。我想在消息框中使用yes no按鈕。但是在消息框中沒有選項是沒有按鈕。我如何使用是的沒有按鈕或其他替代品顯示標題(OK =是和取消=否) 請幫助我。在windows phone 7.5中的消息框yesnoButtons
在此先感謝。
是的,WP MessageBox的問題是它只支持OK和OKCancel MessageBoxButton,這意味着你僅限於ok按鈕或ok和cancel按鈕。 YesNo和YesNoCancel枚舉值不受支持。
基本上,您可以嘗試在頁面內容上顯示半透明消隱層,然後在其上顯示自定義消息框。 Here,你可以找到一個完整的樣本。
另一種選擇是使用像Windows Phone Assets這樣的自定義庫。
另一種選擇是根據自己的需要使用MessagePrompt從Coding4fun工具包和定製
可以使用Coding4Fun MessagePrompt創建以這種方式自定義按鈕是/否消息:
MessagePrompt messagePrompt = new MessagePrompt();
messagePrompt.Message = "Some Message.";
Button yesButton = new Button() { Content = "Yes" };
yesButton .Click += new RoutedEventHandler(yesButton _Click);
Button noButton = new Button() { Content = "No" };
noButton .Click += new RoutedEventHandler(noButton _Click);
messagePrompt.ActionPopUpButtons.Add(noButton);
messagePrompt.ActionPopUpButtons.Add(yesButton);
messagePrompt.Show();
另一種選擇是使用XNA框架中的Guide類。有一個BeginShowMessageBox方法給你選擇傳遞你想要的按鈕的任何字符串。