コード例 #1
0
ファイル: Bids.xaml.cs プロジェクト: nomad-cc20/tea
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            username = (string)(((object[])(e.Parameter))[0]);
            offer    = (OfferDtoIn)(((object[])(e.Parameter))[1]);

            await offer.BuildImage();

            Img.Source = offer.Image;

            ObservableCollection <BidDtoIn> dataList = new ObservableCollection <BidDtoIn>();

            try
            {
                Query.GetBids(offer.OfferId).ForEach(async(BidDtoIn o) => {
                    await o.BuildImage();
                    dataList.Add(o);
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            captionTb.Text       = offer.Caption;
            descriptionTb.Text   = offer.Description;
            userTb.Text          = offer.NameOfPerson;
            bidsList.ItemsSource = dataList;
        }
コード例 #2
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            username = (string)(((object[])(e.Parameter))[0]);
            offer    = (OfferDtoIn)(((object[])(e.Parameter))[1]);

            ObservableCollection <Toy> availableToysList = new ObservableCollection <Toy>();

            try
            {
                Query.GetMyToys(new UserNameDtoOut {
                    username = this.username
                }).ForEach(async(ToyDtoIn dto) =>
                {
                    Toy toy = new Toy(dto);
                    await toy.BuildImage();
                    availableToysList.Add(toy);
                });
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            toysList.ItemsSource = availableToysList;
        }
コード例 #3
0
        private void offersList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            BidDtoIn   bid   = (BidDtoIn)offersList.SelectedItem;
            OfferDtoIn offer = Query.GetOffer(bid.OfferId);

            this.Frame.Navigate(typeof(MyBidDetail), new Object[] { offer, bid });
        }
コード例 #4
0
ファイル: MyBidDetail.xaml.cs プロジェクト: nomad-cc20/tea
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);


            offer = (OfferDtoIn)(((object[])(e.Parameter))[0]);
            bid   = (BidDtoIn)(((object[])(e.Parameter))[1]);

            await offer.BuildImage();

            OfferImg.Source = offer.Image;

            ObservableCollection <Toy> dataListOffer = new ObservableCollection <Toy>();

            offer.Toys.ForEach(async(Toy toy) => {
                await toy.BuildImage();
                dataListOffer.Add(toy);
            });

            OfferCaptionTb.Text       = offer.Caption;
            OfferDescriptionTb.Text   = offer.Description;
            OfferUserTb.Text          = offer.NameOfPerson;
            OfferToysList.ItemsSource = dataListOffer;

            await bid.BuildImage();

            BidImg.Source = bid.Image;

            ObservableCollection <Toy> dataListBid = new ObservableCollection <Toy>();

            bid.Toys.ForEach(async(Toy toy) => {
                await toy.BuildImage();
                dataListBid.Add(toy);
            });

            BidCaptionTb.Text       = bid.Caption;
            BidDescriptionTb.Text   = bid.Description;
            BidUserTb.Text          = bid.NameOfPerson;
            BidToysList.ItemsSource = dataListBid;
        }
コード例 #5
0
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            username = (string)(((object[])(e.Parameter))[0]);
            offer    = (OfferDtoIn)(((object[])(e.Parameter))[1]);

            await offer.BuildImage();

            Image.Source = offer.Image;

            ObservableCollection <Toy> dataList = new ObservableCollection <Toy>();

            offer.Toys.ForEach(async(Toy toy) => {
                await toy.BuildImage();
                dataList.Add(toy);
            });

            CaptionTb.Text       = offer.Caption;
            DescriptionTb.Text   = offer.Description;
            UserTb.Text          = offer.NameOfPerson;
            toysList.ItemsSource = dataList;
        }
コード例 #6
0
        private void offersList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            OfferDtoIn dto = ((OfferDtoIn)offersList.SelectedItem);

            this.Frame.Navigate(typeof(Bids), new object[] { username, dto });
        }
コード例 #7
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            OfferDtoIn dto = ((OfferDtoIn)offersList.SelectedItem);

            this.Frame.Navigate(typeof(OfferDetail), new object[] { username, dto });
        }