title: Xamarin.Forms DataBinding in code for Switch Cell
body: <p>I have the following object:</p>
  
  <pre><code>public class Notification : INotifyPropertyChanged
  {
      private bool _trafficNot;
      public bool TrafficNot 
      {
          get { return _trafficNot; }
          set {
                  if (value.Equals(_trafficNot))
                      return;
                  _trafficNot = value;
                  OnPropertyChanged();
  
              } 
      }
  
      private bool _newsNot;
      public bool NewsNot
      {
          get { return _newsNot; }
          set
          {
              if (value.Equals(_newsNot))
                  return;
              _newsNot = value;
              OnPropertyChanged();
          }
      }
  
     public event PropertyChangedEventHandler PropertyChanged;
  
      void OnPropertyChanged([CallerMemberName]String propertyName=null)
      {
          var handler=PropertyChanged;
          if(handler != null)
          {
              handler(this, new PropertyChangedEventArgs(propertyName));
          }
      }
  
  }
  </code></pre>
  
  <p>I get the data from an a object like this:
   //set up the notification object according to what is stored in the DB
          Notification notification = new Notification
          {</p>
  
  <pre><code>        TrafficNot = uInfo.NotificationTraffic,
          NewsNot = uInfo.NotificationNews
      };
  </code></pre>
  
  <p>and I want to bind the data to these switchells</p>
  
  <pre><code>    TableView tableView = new TableView
      {
          BindingContext = notification,
          Intent = TableIntent.Form,
          Root = new TableRoot
          {
              new TableSection
              {
                  new SwitchCell
                  {
                      Text = "News",
                      BindingContext = "NewsNot"
  
                  },
                  new SwitchCell
                  {
                      Text = "Traffic",
                      BindingContext = "TrafficNot"
                  },
                  new SwitchCell
             }
          }
      };
  </code></pre>
  
  <p>What else do i need to do to bind it?</p>
  
  <p>Cheers</p>