1

我想在我的消息框中显示一个 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);
4

2 回答 2

2

看看这个:http ://coding4fun.codeplex.com/

探索他制作的不同类型的自定义对话框\消息框。您可以将此作为参考并自己制作,也可以直接使用现有的。

于 2012-07-05T11:54:12.017 回答
0

考虑显示为用户提供正确选项的自定义屏幕或 xaml 页面。您可以提供任何您想要的选项。按钮等

于 2012-07-05T09:01:19.330 回答