Application Bar Navigation Issue

4 posts, 1 answers
  1. Daniel
    Daniel avatar
    4 posts
    Member since:
    Jul 2012

    Posted 28 Jul 2012 Link to this post

    Hi Everyone,
    I've been trying to use a ApplicationBar menu item click to open the RadMessageBox download some web stuff based on the button click on the radMessageBox. I have the UI all functional and business logic all functional but when a user finishes the async update and I re-enable user input to navigate away from the page. Then the user navigates the ApplicationBar from the original page including the menu items replaces literally the application bar on the next page.

    So to clarify it seems like the application bar xaml from the first page replaced the xaml on the second page...
    I'm positive it is the control because I implemented it with a standard messagebox and the bug disappeared. I'll post the two implementations which I tested on the cancel button.

    The RadMessageBox has been a direct copy from the sample project so it should not be hard to implement this:
    As a note, I am generating this on an Async Call Completed by
    Dispatcher.BeginInvoke(() =>{
        // insert Message Box Code
    });
    RadMessageBox.Show(new CustomHeaderedContentControl[] 
                                
                                    new CustomHeaderedContentControl() { Title = "Update", Message = "This will update all the app's local storage." },
                                    new CustomHeaderedContentControl() { Title = "Cancel", Message = "Return back to the app. You can always check for updates yourself." }
                                },
                    "Update Phone Data",
                    "There is an update available, do you want to update?",
                    closedHandler: (args) =>
                    {
                        // ClickedButton will be null in the case when RadMessageBox is closed because the user pressed the hardware back button.
                        if (args.ClickedButton == null)
                        {
                            Panorama.IsHitTestVisible = true;
                            ApplicationBarMenuItem update = (ApplicationBarMenuItem)ApplicationBar.MenuItems[1];
                            update.IsEnabled = true;
                            IsolatedStorageSettings s = IsolatedStorageSettings.ApplicationSettings;
                            s["LastUpdate"] = DateTime.Now;
                            s.Save();
                            return;
                        }
      
                        CustomHeaderedContentControl option = (CustomHeaderedContentControl)args.ClickedButton.Content;
                        if (option.Title == "Update")
                        {
                            // Update
                            updater.GetPhoneDatabaseCompleted += new EventHandler<GetPhoneDatabaseCompletedEventArgs>(updater_UpdateClientDBCompleted);
                            TripPlannerItem.Visibility = System.Windows.Visibility.Collapsed;
                            SavedTripsItem.Visibility = System.Windows.Visibility.Collapsed;
                            SettingsItem.Visibility = System.Windows.Visibility.Collapsed;
                            Panorama.IsHitTestVisible = false;
                            UpdateIndicator.IsRunning = true;
                            BusyText = "Updating...";
                            UpdateIndicator.Visibility = System.Windows.Visibility.Visible;
                            updater.GetPhoneDatabaseAsync("METRA");
                              
                        }
                        if (option.Title == "Cancel")
                        {
                            // Cancel, but don't notify the user again today.
                            Panorama.IsHitTestVisible = true;
                            ApplicationBarMenuItem update = (ApplicationBarMenuItem)ApplicationBar.MenuItems[1];
                            update.IsEnabled = true;
                            IsolatedStorageSettings s = IsolatedStorageSettings.ApplicationSettings;
                            s["LastUpdate"] = DateTime.Now;
                            s.Save();                        
                        }
                    });


    For the original message box implementation:
        if (MessageBox.Show("There's an update available do you want to update now?", "Update",
         MessageBoxButton.OKCancel) == MessageBoxResult.OK)
        {
            updater.GetPhoneDatabaseCompleted += new EventHandler<GetPhoneDatabaseCompletedEventArgs>(updater_UpdateClientDBCompleted);
            TripPlannerItem.Visibility = System.Windows.Visibility.Collapsed;
            SavedTripsItem.Visibility = System.Windows.Visibility.Collapsed;
            SettingsItem.Visibility = System.Windows.Visibility.Collapsed;
            Panorama.IsHitTestVisible = false;
            UpdateIndicator.IsRunning = true;
            BusyText = "Updating...";
            UpdateIndicator.Visibility = System.Windows.Visibility.Visible;
            updater.GetPhoneDatabaseAsync("METRA");
        }
        else
        {
            Panorama.IsHitTestVisible = true;
            ApplicationBarMenuItem update = (ApplicationBarMenuItem)ApplicationBar.MenuItems[1];
            update.IsEnabled = true;
            IsolatedStorageSettings s = IsolatedStorageSettings.ApplicationSettings;
            s["LastUpdate"] = DateTime.Now;
            s.Save();                        
        }
    });

    for actually displaying any screenshots I can't really, a video would do it better justice, when the UI is rendering the correct application bar is starting to display and then it is overwritten with the previous page ApplicationBar.

  2. Answer
    Victor
    Admin
    Victor avatar
    1351 posts

    Posted 30 Jul 2012 Link to this post

    Hi Daniel,

    Thanks for the detailed bug report.
    This is a known issue and it has been fixed in the latest internal build.
    Please download it from your account on the Telerik website.
    Please write again if you have more feedback to share.

    Greetings,
    Victor
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. DevCraft banner
  4. Oliver
    Oliver avatar
    2 posts
    Member since:
    Jan 2012

    Posted 01 Aug 2012 Link to this post

    Had the same problem just now. I guess timing is everything.
  5. Daniel
    Daniel avatar
    4 posts
    Member since:
    Jul 2012

    Posted 01 Aug 2012 Link to this post

    I replaced the dll's with the hotfix dll's and it resolved the issue.
Back to Top