Q:

How to break Execution of an override method from it's base class implementation in windows phone?

I am developing a Windows phone application in c# xaml.
I am using MVVM architecture for that.
I have two View Model classes
BaseViewModel:ViewModelBaseX
{
  public override void OnNavigatedTo(NavigationMode mode, Uri uri, IDictionary<string, string> queryString)
  {
     // a condition is checking here & if the condition is true ,  
        i don't want to run the remaining codes in the AboutViewModel .

     TOTO: have to stop the execution here & prevent execution
           of remaining codes in the derived classes.
  }
}

AboutViewModel:BaseViewModel
{
  public override void OnNavigatedTo(NavigationMode mode, Uri uri, IDictionary<string, string> queryString)
  {
      base.OnNavigatedTo(mode, uri, queryString);                

      // here some code to be execute 

  }
}

I know a way by  setting a  property flag in baseviewmodel & checking it in derived view models.
 But it will make code duplication & have to check it in all derived classes.
Is there any other way to that it from Base class?
Please help !

A:

The easiest way is to:
1/ Introduce a new virtual method in BaseViewModel (called something along the lines of "HandleNavigatedTo")  
2/ Have BaseViewModel call "HandleNavigatedTo" based on your criteria 
3/ Have BaseViewModel descendants override "HandleNavigatedTo" and do their stuff in that method 
4/ Have BaseViewModel descendants NOT override "OnNavigatedTo"
public class BaseViewModel : ViewModelBaseX
{

       protected virtual void HandleNavigatedTo(NavigationMode mode, Uri uri, IDictionary<string, string> queryString)
        {
        }

        public override void OnNavigatedTo(NavigationMode mode, Uri uri, IDictionary<string, string> queryString)
        {
            if (condition)
            {
                HandleNavigatedTo(mode, uri, queryString);
             }
        }
    }

    public class AboutViewModel:BaseViewModel
    {
          public override void HandleNavigatedTo(NavigationMode mode, Uri uri, IDictionary<string, string> queryString)
          {
              // here some code to be execute 
          }
     }

