public void OnNavigatingFrom(NavigatingCancelEventArgs e)
        {
            // ask user if navigating away is ok
            string frameDescription;
            if (e.IsParentFrameNavigating){
                frameDescription = "A parent frame";
            }
            else {
                frameDescription = "This frame";
            }

            // modern message dialog supports BBCode tags
            var question = string.Format(CultureInfo.CurrentUICulture, "[b]{0}[/b] is about to navigate to new content. Do you want to allow this?", frameDescription);

            if (MessageBoxResult.No == ModernDialog.ShowMessage(question, "navigate", System.Windows.MessageBoxButton.YesNo)) {
                e.Cancel = true;
            }
        }
 private void Frame_Navigating(object sender, NavigatingCancelEventArgs e)
 {
     LogMessage("Navigating: [{0}] {1}\r\n", e.NavigationType, e.Source);
 }