This question is locked. New answers and comments are not allowed.
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
});
For the original message box implementation:
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.
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.