none
Problems with variables

    Question

  • In trying to design my own way to ask the user to review my app, I have come across a problem.

    When run it will throw an unimplemented exeption, even though there is clearly code to do things.

    and so you can help me out, here is the suspect code:

    public partial class MainPage : PhoneApplicationPage { // Constructor public MainPage() { InitializeComponent();

    ApplicationData.Current.RoamingSettings.Values["0"] = 1;

    if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("5")) { MessageBoxResult result = MessageBox.Show("", "Review this app?", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { MarketplaceReviewTask review = new MarketplaceReviewTask(); review.Show(); } if (result == MessageBoxResult.Cancel) { MessageBoxResult result2 = MessageBox.Show("", "Show this again?", MessageBoxButton.OKCancel); if (result2 == MessageBoxResult.OK) { ApplicationData.Current.RoamingSettings.Values["6"] = 1; } } } } int Review_Reminder = 0; private void Button_Tap(object sender, System.Windows.Input.GestureEventArgs e) { NavigationService.Navigate(new Uri("/Page.xaml", UriKind.RelativeOrAbsolute)); } private void Button1_Tap(object sender, System.Windows.Input.GestureEventArgs e) { NavigationService.Navigate(new Uri("/Page1.xaml", UriKind.RelativeOrAbsolute)); if (Review_Reminder == 0) { ApplicationData.Current.RoamingSettings.Values["1"] = 1; } if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("1")) { ApplicationData.Current.RoamingSettings.Values["2"] = 1; } if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("2")) { ApplicationData.Current.RoamingSettings.Values["3"] = 1; } if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("3")) { ApplicationData.Current.RoamingSettings.Values["4"] = 1; } if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("4")) { ApplicationData.Current.RoamingSettings.Values["5"] = 1; } }

    Unimplimented exception thrown at " if (ApplicationData.Current.RoamingSettings.Values.ContainsKey("5"))"

    Thanks in advance for helping.

    CR.


    • Edited by Caedmonr Wednesday, August 28, 2013 1:39 AM Process of elimination
    Tuesday, August 27, 2013 5:41 PM

Answers

All replies