private void SetSearchText(string value, bool internalCall = false)
 {
     SetField <string>(ref _searchText, value, "SearchText", () =>
     {
         if (!internalCall)
         {
             _searchItem = new PlainTextSearchItem(_searchText);
         }
     });
 }
   public SearchResultsViewModel(INavigationService navigationService, PropertyFinderPersistentState state,
 PropertyListingsResult results, SearchItemBase searchItem, PropertyDataSource dataSource)
   {
       _state = state;
         _navigationService = navigationService;
         _searchItem = searchItem;
         _dataSource = dataSource;
         var propertyViewModels = results.Data.Select(p => new PropertyViewModel(this, state, p)).ToList();
         _properties = new ObservableCollection<PropertyViewModel>(propertyViewModels);
         _totalResult = results.TotalResult;
         _totalPages = results.TotalPages;
   }
        public SearchResultsViewModel(INavigationService navigationService, PropertyFinderPersistentState state,
                                      PropertyListingsResult results, SearchItemBase searchItem, PropertyDataSource dataSource)
        {
            _state             = state;
            _navigationService = navigationService;
            _searchItem        = searchItem;
            _dataSource        = dataSource;
            var propertyViewModels = results.Data.Select(p => new PropertyViewModel(this, state, p)).ToList();

            _properties  = new ObservableCollection <PropertyViewModel>(propertyViewModels);
            _totalResult = results.TotalResult;
            _totalPages  = results.TotalPages;
        }
        private void SearchMyLocation()
        {
            IsLoading = true;
            _geolocationService.GetLocation(location =>
            {
                IsLoading = false;

                if (location == null)
                {
                    UserMessage = "Unable to detect current location. Please ensure location is turned on in your phone settings and try again.";
                }
                else
                {
                    _searchItem = new GeoLocationSearchItem(new GeoLocation()
                    {
                        Latitude  = location.Latitude,
                        Longitude = location.Longitude
                    });
                    SetSearchText(_searchItem.DisplayText, true);
                    SearchForProperties();
                }
            });
        }
Exemplo n.º 5
0
 public RecentSearch(SearchItemBase searchItem, int resultsCount, PropertyFinderViewModel parent)
 {
     Search = searchItem;
       ResultsCount = resultsCount;
       Parent = parent;
 }
 private void LocationSelected(Location location)
 {
     _searchItem = new PlainTextSearchItem(location.Name, location.DisplayName);
     SetSearchText(_searchItem.DisplayText, true);
     SearchForProperties();
 }
 private void RecentSearchSelected(RecentSearch recentSearch)
 {
     _searchItem = recentSearch.Search;
     SetSearchText(_searchItem.DisplayText, true);
     SearchForProperties();
 }
Exemplo n.º 8
0
 public RecentSearch(SearchItemBase searchItem, int resultsCount, PropertyFinderViewModel parent)
 {
     Search       = searchItem;
     ResultsCount = resultsCount;
     Parent       = parent;
 }
 private void SetSearchText(string value, bool internalCall = false)
 {
     SetField<string>(ref _searchText, value, "SearchText", () =>
       {
     if (!internalCall)
     {
       _searchItem = new PlainTextSearchItem(_searchText);
     }
       });
 }
        private void SearchMyLocation()
        {
            IsLoading = true;
              _geolocationService.GetLocation(location =>
            {
              IsLoading = false;

              if (location == null)
              {
            UserMessage = "Unable to detect current location. Please ensure location is turned on in your phone settings and try again.";
              }
              else
              {
            _searchItem = new GeoLocationSearchItem(new GeoLocation()
            {
              Latitude = location.Latitude,
              Longitude = location.Longitude
            });
            SetSearchText(_searchItem.DisplayText, true);
            SearchForProperties();
              }
            });
        }
 private void RecentSearchSelected(RecentSearch recentSearch)
 {
     _searchItem = recentSearch.Search;
       SetSearchText(_searchItem.DisplayText, true);
       SearchForProperties();
 }
 private void LocationSelected(Location location)
 {
     _searchItem = new PlainTextSearchItem(location.Name, location.DisplayName);
       SetSearchText(_searchItem.DisplayText, true);
       SearchForProperties();
 }