Programmatically Closing the WP7 Coding4Fun MessagePrompt Control Toolkit

I am using the MessagePrompt control from the Coding4Fun toolkit to show the Rate and View dialog in my application.

I replaced the default buttons with custom buttons, and also cleared the existing buttons (to get rid of ticks and crosses), but I could not determine which method to call to close the invitation.

This is the code that I use, I'd like to close the prompt in the click method of the cancel button

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();
+3
source share
1 answer

The newest toolkit check provides the Hide () method to solve this problem.

cancelButton.Click += (sender, e) =>
{
    messagePrompt.Hide();
};
+2
source

All Articles