以编程方式关闭WP7 Coding4Fun工具包MessagePrompt控件

时间:2011-05-02 02:07:16

标签: c# windows-phone-7

我正在使用Coding4Fun工具包中的MessagePrompt控件在我的应用程序中显示“Rate and Review”对话框。

我已使用自定义按钮替换默认按钮以及清除现有按钮(以消除刻度线和十字架),但无法确定要关闭提示的方法。

这是我正在使用的代码,我想在取消按钮的点击方法中关闭提示

var messagePrompt = new MessagePrompt
{
    Title = "Rate and Review",
    IsAppBarVisible = false,
    Body = new TextBlock
    {
        Text = "PLS REVIEW MY APP K THNX",
        TextWrapping = TextWrapping.Wrap
    }
};

var rateButton = new Button() { Content = "Rate and Review" };
rateButton.Click += (sender, e) =>
{
    var m = new MarketplaceDetailTask
    {
        ContentIdentifier = PhoneState.AppID,
        ContentType = MarketplaceContentType.Applications
    };

    m.Show();
};

var cancelButton = new Button() { Content = "Dismiss" };
cancelButton.Click += (sender, e) =>
{
    //todo close messagePrompt here
};

messagePrompt.ActionPopUpButtons.Clear();
messagePrompt.ActionPopUpButtons.Add(rateButton);
messagePrompt.ActionPopUpButtons.Add(cancelButton);

messagePrompt.Show();

1 个答案:

答案 0 :(得分:2)

最新的工具包签入公开了Hide()方法来解决这个问题。

cancelButton.Click += (sender, e) =>
{
    messagePrompt.Hide();
};
相关问题