Fix for the rating component used in one of DVLUPs update challenges

I found a minor bug in the DVLUPS RateMyApp component. This is a fix to not upset the user by repeatedly showing the second feedback overlay when Back-button is used to return to the start page.

Reproduce the issue

Check if your version of the component contains the issue by

1: restarting your app until the SECOND rating request overlay is showed. This is by default the tenth time the app is started.
2: answer “no” to close the overlay.
3: navigate to an other page in your app.
4: press the back-button.

This will show the overlay again and the issue will continue this way until the app is restarted and the user might become a bit grumpy.

Fix

Open the FeedbackOverlay.xaml.cs file and use a _secondReviewIsHandled flag to make the second overlay just show once:

private bool _secondReviewIsHandled;

private void FeedbackOverlay_Loaded(object sender, RoutedEventArgs e)
{
    this.AttachBackKeyPressed();

    if (FeedbackOverlay.GetEnableAnimation(this))
    {
        this.LayoutRoot.Opacity = 0;
        this.xProjection.RotationX = 90;
    }

    if (FeedbackHelper.Default.State == FeedbackState.FirstReview)
    {
        this.SetVisibility(true);
        this.SetupFirstMessage();

        if (FeedbackOverlay.GetEnableAnimation(this))
            this.showContent.Begin();
    }
    else if (FeedbackHelper.Default.State == FeedbackState.SecondReview && _secondReviewIsHandled == false)
    {
        this.SetVisibility(true);
        this.SetupSecondMessage();

        if (FeedbackOverlay.GetEnableAnimation(this))
            this.showContent.Begin();
        _secondReviewIsHandled = true;
    }
    else
    {
        this.SetVisibility(false);
    }
}

Trackback URL: https://codeblog.silfversparre.com/2013/12/fix-ratemyapp-component-dvlup-go-ahead-rate-app-update-challenge/trackback/