title: SearchBar and Xamarin.Form
body: <p>Am working on a XF project which has a SearchBar. The XAML Declaration looks like following.</p>
  
  <pre><code>&lt;SearchBar Placeholder="Result" Text="{Binding SearchedCustomer,Mode=TwoWay}" 
                  SearchCommand="{Binding SearchCustomerCommand}"&gt;&lt;/SearchBar&gt;
  </code></pre>
  
  <p>At ViewModel, I have following declared</p>
  
  <pre><code>    private string _SearchedCustomer;
      public string SearchedCustomer
      {
          get { return _SearchedCustomer; }
          set { SetProperty(ref _SearchedCustomer, value); }
      }
  
      public DelegateCommand SearchCustomerCommand { get; set; }
  
      private ObservableCollection&lt;CustomerModel&gt; _CustomerList;
      public ObservableCollection&lt;CustomerModel&gt; CustomerList
      {
          get
          {
              if (_CustomerList == null)
                  FillCustomerDetails();
              return _CustomerList;
          }
          set { SetProperty(ref _CustomerList, value); }
      }
  
      private void ExecuteSearchCustomerCommand()
      {
          var tempRecords = _CustomerList.Where(c =&gt; c.ReferenceText.Contains(SearchedCustomer));
          CustomerList.Clear();
          foreach (var item in tempRecords)
          {
              CustomerList.Add(item);
          }
      }
  </code></pre>
  
  <p>I also have the SearchCustomerCommand created in the Constructor as following</p>
  
  <pre><code>SearchCustomerCommand = new DelegateCommand(ExecuteSearchCustomerCommand).ObservesProperty(()=&gt; SearchedCustomer);
  </code></pre>
  
  <p>When I type in the SearchBar, the SearchedCustomer Fields gets changed, however, the Command SearchCustomerCommand is not executed.</p>
  
  <p>Could someone help me in identifying what I am doing wrong here ?</p>