public UsersSearchResultsViewModel(string query)
 {
   this._searchVM = new GenericCollectionViewModel2<VKList<User>, SubscriptionItemHeader>((ICollectionDataProvider2<VKList<User>, SubscriptionItemHeader>) this);
   this._searchName = query;
   this._searchParamsViewModel = new SearchParamsViewModel((ISupportSearchParams) this);
   EventAggregator.Current.Subscribe((object) this);
 }
Exemplo n.º 2
0
 public CityPickerViewModel(long countryId, City selectedCity = null, bool allowNoneSelection = true)
 {
     this._countryId          = countryId;
     this._selectedCity       = selectedCity;
     this._allowNoneSelection = allowNoneSelection;
     this._searchVM           = new GenericCollectionViewModel2 <VKList <City>, CityListItem>((ICollectionDataProvider2 <VKList <City>, CityListItem>) this);
 }
Exemplo n.º 3
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <NewsFeedData, IVirtualizable> caller, int count)
 {
     if (count == 0)
     {
         return(CommonResources.NoNews);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneNewsFrm, CommonResources.TwoFourNewsFrm, CommonResources.FiveNewsFrm, true, null, false));
 }
Exemplo n.º 4
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <VKList <User>, SubscriptionItemHeader> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoPersons);
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OnePersonFrm, CommonResources.TwoFourPersonsFrm, CommonResources.FivePersonsFrm, true, null, false));
 }
        public void Insert(T item, int ind)
        {
            this._updatingCollection = true;
            this._collection.Insert(ind, item);
            this.AddRemoveKeyToDict(item, true);
            this._updatingCollection = false;
            this._totalCount         = this._totalCount + GenericCollectionViewModel2 <B, T> .GetElementsCountForItem(item);

            this.NotifyChanged();
        }
        private void Initialize()
        {
            this.LoadCount   = 30;
            this.ReloadCount = 40;
            this.OffsetKnob  = 15;
            this._status     = new GenericCollectionViewModel2 <B, T> .Status();

            this._tryAgainCmd = (ICommand) new DelegateCommand((Action <object>)(o => this.LoadData(this._refresh, false, false, false, null, null, false)));
            this._settingsCmd = (ICommand) new DelegateCommand((Action <object>)(type => this.NavigateToCommunicationSettings((ConnectionSettingsType)Enum.Parse(typeof(ConnectionSettingsType), type.ToString(), false))));
        }
Exemplo n.º 7
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <VKList <City>, CityListItem> caller, int count)
 {
     if (count <= 0)
     {
         return(CommonResources.NoCities);
     }
     if (string.IsNullOrWhiteSpace(this._query) && this._allowNoneSelection)
     {
         --count;
     }
     return(UIStringFormatterHelper.FormatNumberOfSomething(count, CommonResources.OneCityFrm, CommonResources.TwoFourCitiesFrm, CommonResources.FiveCitiesFrm, true, null, false));
 }
        public void Delete(T item)
        {
            this._updatingCollection = true;
            if (this._collection.Remove(item))
            {
                this.AddRemoveKeyToDict(item, false);
                this._totalCount = this._totalCount - GenericCollectionViewModel2 <B, T> .GetElementsCountForItem(item);

                this.NotifyChanged();
            }
            this._updatingCollection = false;
        }
Exemplo n.º 9
0
 public void GetData(GenericCollectionViewModel2 <NewsFeedData, IVirtualizable> caller, int offset, int count, Action <BackendResult <NewsFeedData, ResultCode> > callback)
 {
     if (offset > 0 && string.IsNullOrWhiteSpace(this._from))
     {
         callback(new BackendResult <NewsFeedData, ResultCode>(ResultCode.Succeeded, new NewsFeedData()));
     }
     else
     {
         string startFrom = offset == 0 ? "" : this._from;
         if (offset == 0)
         {
             this._startTime = VKClient.Common.Utils.Extensions.DateTimeToUnixTimestamp(DateTime.UtcNow - TimeSpan.FromDays(365.0), true);
             this._endTime   = VKClient.Common.Utils.Extensions.DateTimeToUnixTimestamp(DateTime.UtcNow, true);
         }
         NewsFeedService.Current.Search(this._query, 20, this._startTime, this._endTime, startFrom, callback);
     }
 }
        public void DeleteGrouped(T item)
        {
            this._updatingCollection = true;
            if (this._collection.Remove(item))
            {
                this.AddRemoveKeyToDict(item, false);
                this._totalCount = this._totalCount - GenericCollectionViewModel2 <B, T> .GetElementsCountForItem(item);

                this.NotifyChanged();
            }
            foreach (Group <T> grouped in (System.Collections.ObjectModel.Collection <Group <T> >) this.GroupedCollection)
            {
                if (grouped.Contains(item))
                {
                    grouped.Remove(item);
                    this._totalCount = this._totalCount - GenericCollectionViewModel2 <B, T> .GetElementsCountForItem(item);

                    this.NotifyChanged();
                }
            }
            this._updatingCollection = false;
        }
Exemplo n.º 11
0
 public void GetData(GenericCollectionViewModel2 <VKList <City>, CityListItem> caller, int offset, int count, Action <BackendResult <VKList <City>, ResultCode> > callback)
 {
     DatabaseService.Instance.GetCities(this._query, this._countryId, !string.IsNullOrWhiteSpace(this._query), offset, count, callback);
 }
Exemplo n.º 12
0
 public string GetFooterTextForCount(GenericCollectionViewModel2 <VKList <B>, T> caller, int count)
 {
     return(this._searchDataProvider.GetFooterTextForCount(count));
 }
Exemplo n.º 13
0
 public void GetData(GenericCollectionViewModel2 <VKList <B>, T> caller, int offset, int count, Action <BackendResult <VKList <B>, ResultCode> > callback)
 {
     this._searchDataProvider.GetData(this.SearchString, this.Parameters, offset, count, callback);
 }
 public void GetData(GenericCollectionViewModel2<VKList<User>, SubscriptionItemHeader> caller, int offset, int count, Action<BackendResult<VKList<User>, ResultCode>> callback)
 {
   UsersService.Instance.Search(this._searchParamsViewModel.SearchParams, this.SearchName, offset, count, callback);
 }
Exemplo n.º 15
0
 public void GetData(GenericCollectionViewModel2 <WallData, IVirtualizable> caller, int offset, int count, Action <BackendResult <WallData, ResultCode> > callback)
 {
     WallService.Current.Search(this._ownerId, this._domain, this._query, count, offset, callback);
 }