예제 #1
0
        private async void PickerLiquidationPost_Clicked(object sender, EventArgs e)
        {
            ModalPicker.Title      = Language.chon_tu_san_pham_thanh_ly;
            loadingPopup.IsVisible = true;
            if (FilterLiquidationPage == null)
            {
                FilterLiquidationPage = new ContentView();

                LiquidationFilterViewModel filterViewModel = new LiquidationFilterViewModel();
                filterViewModel.FilterModel.CreatedById = Guid.Parse(UserLogged.Id);
                filterViewModel.FilterModel.Status      = 0;
                FilterLiquidationPage.BindingContext    = filterViewModel;
                BsdListView bsdListView = new BsdListView()
                {
                    ItemTemplate = new DataTemplate(typeof(Views.Cells.LiquidationCells.LiquidationViewCell))
                };
                bsdListView.ItemTapped += async(object listview, ItemTappedEventArgs listviewEventArgs) =>
                {
                    var item = listviewEventArgs.Item as Liquidation;
                    var post = new LiquidationCommentPost
                    {
                        Title     = item.Name,
                        Avatar    = item.Avatar,
                        PostId    = item.Id.ToString(),
                        PriceText = item.Price > 0 ? string.Format("{0:0,0 đ}", item.Price) : "",
                        Address   = item.Address
                    };
                    viewModel.SendLiquidationtMessage(post);
                    await ModalPicker.Hide();
                };

                await filterViewModel.LoadData();

                FilterLiquidationPage.Content = bsdListView;
            }

            ContentViewLookUp.Content = FilterLiquidationPage;
            await ModalPicker.Show();

            loadingPopup.IsVisible = false;
        }
예제 #2
0
        private async void PickFurnitureProduct_Clicked(object sender, EventArgs e)
        {
            ModalPicker.Title      = Language.chon_tu_san_pham_noi_that;
            loadingPopup.IsVisible = true;
            if (FilterFurntiureProductPage == null)
            {
                FilterFurntiureProductPage = new ContentView();

                FilterFurnitureProductViewModel filterViewModel = new FilterFurnitureProductViewModel();
                filterViewModel.FilterModel.CreatedById   = Guid.Parse(UserLogged.Id);
                FilterFurntiureProductPage.BindingContext = filterViewModel;
                BsdListView bsdListView = new BsdListView()
                {
                    ItemTemplate = new DataTemplate(typeof(Views.Cells.FurnitureCells.ProductViewCell))
                };
                bsdListView.ItemTapped += async(object listview, ItemTappedEventArgs listviewEventArgs) =>
                {
                    var item    = listviewEventArgs.Item as FurnitureProduct;
                    var product = new FurnitureProductChatMessage
                    {
                        Title     = item.Name,
                        Avatar    = item.AvatarUrl,
                        ProductId = item.Id.ToString(),
                        PriceText = item.Price.HasValue ? string.Format("{0:0,0 đ}", item.Price.Value) : "",
                        Address   = item.Address
                    };
                    viewModel.SendFurnitureProductMessage(product);
                    await ModalPicker.Hide();
                };

                await filterViewModel.LoadData();

                FilterFurntiureProductPage.Content = bsdListView;
            }

            ContentViewLookUp.Content = FilterFurntiureProductPage;
            await ModalPicker.Show();

            loadingPopup.IsVisible = false;
        }
예제 #3
0
        private async void PickPost_Clicked(object sender, EventArgs e)
        {
            ModalPicker.Title      = Language.chon_bat_dong_san;
            loadingPopup.IsVisible = true;
            if (FilterPostPage == null)
            {
                FilterPostPage = new ContentView();
                SearchPageResultViewModel filterViewModel = new SearchPageResultViewModel();
                filterViewModel.FilterModel.CreatedById = Guid.Parse(UserLogged.Id);
                FilterPostPage.BindingContext           = filterViewModel;
                BsdListView bsdListView = new BsdListView()
                {
                    ItemTemplate = new DataTemplate(typeof(Cells.PostViewCell))
                };
                bsdListView.ItemTapped += async(object listview, ItemTappedEventArgs listviewEventArgs) =>
                {
                    var item = listviewEventArgs.Item as SundihomeApi.Entities.Post;
                    var post = new SundihomeApi.Entities.Mongodb.Post()
                    {
                        Title     = item.Title,
                        Avatar    = item.Avatar,
                        PostId    = item.Id.ToString(),
                        PriceText = item.PriceFormatText,
                        Address   = item.Address
                    };
                    viewModel.SendPostMessage(post);
                    await ModalPicker.Hide();
                };

                await filterViewModel.LoadData();

                FilterPostPage.Content = bsdListView;
            }

            ContentViewLookUp.Content = FilterPostPage;
            await ModalPicker.Show();

            loadingPopup.IsVisible = false;
        }