public SearchResultsViewModel(PropertyFinderPersistentState stateFactory, PropertyDataSource dataSource) { _stateFactory = stateFactory; _dataSource = dataSource; Properties= new ObservableCollection<PropertyViewModel>(); PropertiesSelectedCommand = new MvxCommand<PropertyViewModel>(DoPropertiesSelected); LoadMoreCommand = new MvxCommand(DoLoadMore); Title = "Loading..."; }
public PropertyFinderViewModel(PropertyFinderPersistentState stateFactory, PropertyDataSource dataSource, IGeoLocationService geolocationService) { _state = stateFactory; _dataSource = dataSource; _geolocationService = geolocationService; SearchCommand = new MvxCommand(DoSearch); UseLocationCommand = new MvxCommand(DoUseLocation); ShowFavouritesCommand = new MvxCommand(DoShowFavourites); RecentSearchSelectedCommand = new MvxCommand<RecentSearch>(DoRecentSearchSelected); LocationSelectedCommand = new MvxCommand<Location>(DoLocationSelected); SuggestedLocations = new ObservableCollection<Location>(); RecentSearches = new ObservableCollection<RecentSearch>(); LoadRecentSearches(); }
public override void FindProperties(PropertyDataSource dataSource, int pageNumber, Action<PropertyDataSourceResult> callback, Action<Exception> error) { dataSource.FindProperties(SearchText, pageNumber, callback, error); }
/// <summary> /// Executes the search that this item represents. /// </summary> public abstract void FindProperties(PropertyDataSource dataSource, int pageNumber, Action<PropertyDataSourceResult> callback, Action<Exception> error);
public override void FindProperties(PropertyDataSource dataSource, int pageNumber, Action<PropertyDataSourceResult> callback, Action<Exception> error) { dataSource.FindProperties(Location.Latitude, Location.Longitude, pageNumber, callback, error); }