title: Inheritance in Xamarin Android
body: <p>I use Xamarin for Android. I have two activities with some content, there is <code>android.support.v4.widget.DrawerLayout</code> and <code>android.support.design.widget.NavigationView</code> in XML files.</p>
  
  <p>In MainActivity I use two object for content control. These are <code>DrawerLayout</code> and <code>NavigationView</code>. To switch between activities I use own method.</p>
  
  <pre><code>private void OnNavigationItemSelected(object sender, NavigationView.NavigationItemSelectedEventArgs e)
      {
          switch (e.MenuItem.ItemId)
          {
              case (Resource.Id.home):
                  //Go home
  
                  break;
  
              case (Resource.Id.settings):
                  //Go to other activity
                  break;
          }
  
          drawerLayout.CloseDrawers();
      }
  </code></pre>
  
  <p><code>DrawerLayout</code>, <code>NavigationView</code> and <code>OnNavigationItemSelected</code> is located in MainActivity, but I've created one more activities. This is <code>Settings</code> and when I chose settings item, I'm moving to <code>Settings</code> activity.</p>
  
  <p>I wrote the same implementation in <code>Settings</code> activity. I have <code>DrawerLayout</code>, <code>NavigationView</code> and <code>OnNavigationItemSelected</code>.</p>
  
  <p>It turns out that I just copied code. Maybe I should use inheritance? I just don't understand how can I realize that in Android application.</p>