Пример #1
0
        public void Init(IProfileData profileData)
        {
            this._profileData = profileData;
            this._isGroup     = this._profileData is GroupData;
            List <MediaListItemViewModelBase> items = ProfileMarketViewModel.CreateItems(profileData);

            if (!this._profileData.isMarketMainAlbumEmpty && this._isGroup)
            {
                Group group = ((GroupData)this._profileData).group;
                int?  nullable;
                if (group == null)
                {
                    nullable = new int?();
                }
                else
                {
                    VKClient.Common.Backend.DataObjects.Market market = group.market;
                    nullable = market != null ? new int?(market.main_album_id) : new int?();
                }
                this._marketAlbumId = nullable ?? 0;
            }
            if (!ProfileMarketViewModel.AreItemsEqual((IList <MediaListItemViewModelBase>)items, (IList <MediaListItemViewModelBase>) this._itemsVM.Collection))
            {
                this._offset = items.Count;
                this._cachedSources.Clear();
                foreach (ProductMediaListItemViewModel listItemViewModel in items)
                {
                    this._cachedSources.Add(listItemViewModel.ImageUri);
                }
                this.Items = new ObservableCollection <MediaListItemViewModelBase>(items);
                this._itemsVM.LoadData(true, true, true, true, (Action <List <MediaListItemViewModelBase> >)null, (Action <BackendResult <VKList <Product>, ResultCode> >)null, false);
            }
            this.NotifyPropertyChanged <int>((System.Linq.Expressions.Expression <Func <int> >)(() => this.Count));
            this.NotifyPropertyChanged <bool>((System.Linq.Expressions.Expression <Func <bool> >)(() => this.CanDisplay));
        }
Пример #2
0
 public void ContactSeller()
 {
     VKClient.Common.Backend.DataObjects.Market market = this._group.market;
     if (market == null || market.contact_id == 0L)
     {
         return;
     }
     EventAggregator.Current.Publish((object)new MarketContactEvent(string.Format("{0}_{1}", (object)this._product.owner_id, (object)this._product.id), MarketContactAction.start));
     this.PrepareProductForSharing(CommonResources.ContactSellerMessage);
     Navigator.Current.NavigateToConversation(market.contact_id, false, false, "", 0L, true);
 }
Пример #3
0
        public void NavigateToMarketWiki()
        {
            VKClient.Common.Backend.DataObjects.Market market = this._group.market;
            string str;

            if (market == null)
            {
                str = null;
            }
            else
            {
                Wiki wiki = market.wiki;
                str = wiki != null ? wiki.view_url : null;
            }
            if (string.IsNullOrEmpty(str))
            {
                return;
            }
            Navigator.Current.NavigateToWebUri(this._group.market.wiki.view_url, true, false);
        }
Пример #4
0
        private void UpdateWikiPage()
        {
            VKClient.Common.Backend.DataObjects.Market market = this._group.market;
            string str1;

            if (market == null)
            {
                str1 = null;
            }
            else
            {
                Wiki wiki = market.wiki;
                str1 = wiki != null ? wiki.title : null;
            }
            string str2 = str1;

            if (string.IsNullOrEmpty(str2))
            {
                return;
            }
            this.WikiPageVisibility = Visibility.Visible;
            this.WikiPageName       = str2;
        }