title: Add object to ObservableCollection List object
body: <p>How to add one object to ObservableCollection list object? I have class called "Assest" and I have created ObservableCollection list of Asset and I want to maintain it like adding and deleting element from that ObservableCollection list. Now I'm getting error when I try to add single element to ObservableCollection.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>    private static ObservableCollection&lt;Assest&gt; _collection = null;
  
      public ObservableCollection&lt;Assest&gt; AssestList
      {
          get
          {
              if (_collection == null)
              {
                  _collection = new ObservableCollection&lt;Assest&gt;();
              }
              return _collection;
          }
          set { _collection = value; }
      }
  
      public static ObservableCollection&lt;Assest&gt; ToObservableCollection(List&lt;Assest&gt; assestList)
      {
          return new ObservableCollection&lt;Assest&gt;(assestList);
      }
  
      public MainWindow()
      {
          InitializeComponent();
          this.DataContext = this;
          LoadData();
          comboBox1.ItemsSource = AssestList;
      }
  
      private void LoadData()
      {
          Assest assest = new Assest() { AppID = "1", AssestName = "AppName", AppDescription = "Description" };
          Assest assest2 = new Assest { AppDescription = "Des2", AppID = "2", AssestName = "hi" };
  
          List&lt;Assest&gt; assList = new List&lt;Assest&gt; {assest, assest2};
  
          ObservableCollection&lt;Assest&gt; generatedAssestList = ToObservableCollection(assList);
          AssestList = generatedAssestList;
      }
  
      // Here I get an error.
  
      public static void AddAppToObservalCollection(Assest ass)
      {
          _collection.Add(ass);
      }
  </code></pre>
  
  <p>So How to over come these kind of situations. Thanks everyone.</p>