public async Task StoreListingSelected(StoreListingModel storeListing)
        {
            await this.window.RunAsyncOperation(async() =>
            {
                this.LandingSearchGrid.Visibility = Visibility.Collapsed;
                this.DetailsGrid.Visibility       = Visibility.Visible;
                this.BackButton.Visibility        = Visibility.Visible;

#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
                this.DetailsUserAvatar.SetUserAvatarUrl(storeListing.UserID);
#pragma warning restore CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed

                this.RateReviewButton.Visibility = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.ReportButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.RemoveButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Visible : Visibility.Collapsed;

                this.DetailsGrid.DataContext = this.currentListing = await ChannelSession.Services.MixItUpService.GetStoreListing(storeListing.ID);

                this.currentReviews.Clear();
                foreach (StoreListingReviewModel review in this.currentListing.Reviews)
                {
                    this.currentReviews.Add(new ListingUserReviewControl(review));
                }
            });
        }
Exemplo n.º 2
0
 public StoreListingControl(MainStoreControl mainStoreControl, StoreListingModel listing)
 {
     this.mainStoreControl = mainStoreControl;
     if (listing != null)
     {
         this.DataContext = this.listing = listing;
     }
 }
Exemplo n.º 3
0
        public async Task <StoreListingModel> GetTopRandomStoreListings()
        {
            IEnumerable <StoreListingModel> listings = await this.GetAsync <IEnumerable <StoreListingModel> >("store/top");

            if (listings != null && listings.Count() > 0)
            {
                StoreListingModel listing = listings.FirstOrDefault();
                await listing.SetUser();

                return(listing);
            }
            return(null);
        }
        public async Task StoreListingSelected(StoreListingModel storeListing)
        {
            await this.window.RunAsyncOperation(async() =>
            {
                this.LandingSearchGrid.Visibility = Visibility.Collapsed;
                this.DetailsGrid.Visibility       = Visibility.Visible;
                this.BackButton.Visibility        = Visibility.Visible;

                this.RateReviewButton.Visibility = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.ReportButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.RemoveButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Visible : Visibility.Collapsed;

                this.DetailsGrid.DataContext = this.currentListing = await ChannelSession.Services.MixItUpService.GetStoreListing(storeListing.ID);
            });
        }
        public async Task StoreListingSelected(StoreListingModel storeListing)
        {
            await this.window.RunAsyncOperation(async() =>
            {
                this.LandingSearchGrid.Visibility = Visibility.Collapsed;
                this.DetailsGrid.Visibility       = Visibility.Visible;
                this.BackButton.Visibility        = Visibility.Visible;

                this.DetailsUserAvatar.SetImageUrl(storeListing.UserAvatar);
                this.RateReviewButton.Visibility = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.ReportButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Collapsed : Visibility.Visible;
                this.RemoveButton.Visibility     = (storeListing.IsCommandOwnedByUser) ? Visibility.Visible : Visibility.Collapsed;

                this.DetailsGrid.DataContext = this.currentListing = await ChannelSession.Services.MixItUpService.GetStoreListing(storeListing.ID);

                this.currentReviews.Clear();
                foreach (StoreListingReviewModel review in this.currentListing.Reviews)
                {
                    this.currentReviews.Add(new ListingUserReviewControl(review));
                }
            });
        }
Exemplo n.º 6
0
 public async Task AddStoreListingDownload(StoreListingModel listing)
 {
     await this.PostAsync("store/metadata/downloads", listing.ID);
 }
 public SmallCommandListingControl(MainStoreControl mainStoreControl, StoreListingModel listing)
     : base(mainStoreControl, listing)
 {
     InitializeComponent();
 }