我想在我的消息框中显示一个 URL,用户可以在 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);