我想在我的消息框中显示一个用户可以点击并导航到Wp7芒果的URL。这可能吗?如果是,我该如何实施呢?
我的消息框编码如下:
public static void customizedMessageBox(int messageboxtype, string title, string text, IEnumerable<string> buttons, int focusbutton, MessageBoxIcon icon, AsyncCallback callback, object state)
{
if (!Guide.IsVisible)
{
try
{
ProgressBarControl.dismissProgressBar();
Guide.BeginShowMessageBox(" ", text, buttons, focusbutton, MessageBoxIcon.None, callback, state);
messageboxType = messageboxtype;
}
catch (GuideAlreadyVisibleException ex)
{
Logger.log("MsgBox", "Exception : messageboxtype: " + messageboxtype
+ "\n" + ex.Message + "\n" + ex.StackTrace);
}
}
//return messageboxtype;
}
public static void OnMessageBoxClosed(IAsyncResult ar)
{
int? dialogResult = Guide.EndShowMessageBox(ar);
Game game;
try
{
Logger.log("MsgBox", "result: " + dialogResult + " msg type: " + messageboxType);
switch (messageboxType)
{ case 7:
//ERROR E4000 case
switch (dialogResult)
{
case 0:
string url;
//url = CacheManager.getInstance().getApplicationSettings(CacheManager.APP_APK_UPGRADE_URI);
url = DataManager.URL_VALUE;
if (Utils.isNullString(url))
{
//url = CacheManager.getInstance().getUpgradeURL();
}
WebBrowserTask browse = new WebBrowserTask();
browse.URL = url;
browse.Show();
break;
default:
//delete data from the DB
ProgressBarControl.displayProgressBar(0, 10, AppResources.DOWNLOADING);
try
{
//byte[] data = (byte[])CacheManager.getInstance().getPersistanceData(Utils.MINOR_UPGRADE_DATA);
byte[] data = (byte[])CacheManager.getInstance().getDataFromDataFile();
if (data != null && data.Length > 0)
{
DataManager.getInstance().processMyWidgetResponse(data);
DataManager.getInstance().refresUI();
}
}
catch (Exception ex)
{
}
finally
{
//CacheManager.getInstance().deletaFromApplicationCache(Utils.MINOR_UPGRADE_DATA);
}
break;
}
break;
default:
break;
}
}
catch (Exception ex)
{
Logger.log(TAG, ex.Message);
}
finally
{
ProgressBarControl.dismissProgressBar();
}
}
我正在调用这样的消息框: -
UIListen.customizedMessageBox(Utils.ERROR_CODE_E4000, ERROR_FORCE_REGISTRATION, responseHeaders[HEADER_URL_NAME, 1], Utils.valuesOk, 0);
答案 0 :(得分:2)
看看这个:http://coding4fun.codeplex.com/
探索他制作的不同类型的自定义对话框\消息框。您可以将其作为参考并自行制作,或者您可以直接使用现有的。
答案 1 :(得分:0)
考虑显示自定义屏幕或xaml页面,为用户提供正确的选项。您可以提供任何您想要的选项。按钮等。