This is a migrated thread and some comments may be shown as answers.

Application Bar Navigation Issue

3 Answers 72 Views
MessageBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 1
Daniel asked on 28 Jul 2012, 11:03 PM
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.

3 Answers, 1 is accepted

Sort by
0
Accepted
Victor
Telerik team
answered on 30 Jul 2012, 06:28 AM
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.

0
Oliver
Top achievements
Rank 1
answered on 02 Aug 2012, 01:08 AM
Had the same problem just now. I guess timing is everything.
0
Daniel
Top achievements
Rank 1
answered on 02 Aug 2012, 03:59 AM
I replaced the dll's with the hotfix dll's and it resolved the issue.
Tags
MessageBox
Asked by
Daniel
Top achievements
Rank 1
Answers by
Victor
Telerik team
Oliver
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
Share this question
or