예제 #1
0
        public async Task Appearing()
        {
            var items = await requestHelper.Get <IEnumerable <GoodCategory> >($"http://rstore.kikoriki.space/GoodCategory/{ sessionData.SessionToken }");

            Elements.Clear();
            foreach (var item in items)
            {
                var category = new ActionModel <GoodCategory>(item)
                {
                    Text        = item.Name,
                    Description = item.Description,
                    ExecAction  = async f => await Page.Navigation.PushAsync(new EditCategory(item))
                };

                category.AddLeftSwipe("Delete", Color.Red, new Command(async f => await DeleteCategory(f as GoodCategory)));
                category.AddRightSwipe("Edit", Color.Yellow, new Command(async f => await EditCategory(f as GoodCategory)));
                category.AddRightSwipe("Params", Color.Gray, new Command(async f => await ShowParams(f as GoodCategory)));

                Elements.Add(category);
            }
        }
예제 #2
0
        public async Task Appearing()
        {
            var items = await requestHelper.Get <IEnumerable <Good> >($"http://rstore.kikoriki.space/GoodList/{ sessionData.SessionToken }");

            Elements.Clear();
            foreach (var item in items)
            {
                var good = new ActionModel <Good>(item)
                {
                    Text        = item.Title,
                    Description = item.Price.ToString(),
                    ExecAction  = async f => await Page.Navigation.PushAsync(new EditGood(item))
                };

                good.AddLeftSwipe("Delete", Color.Red, new Command(async f => await DeleteGood(f as Good)));
                good.AddLeftSwipe("Storage", Color.Blue, new Command(async f => await ShowStorage(f as Good)));
                good.AddRightSwipe("Edit", Color.Yellow, new Command(async f => await EditGood(f as Good)));
                good.AddRightSwipe("Params", Color.Gray, new Command(async f => await ShowParams(f as Good)));

                Elements.Add(good);
            }
        }
예제 #3
0
        public async Task Appearing()
        {
            var items = await requestHelper.Get <IEnumerable <GoodProperty> >($"http://rstore.kikoriki.space/GoodProperty/{ sessionData.SessionToken }");

            Elements.Clear();
            foreach (var item in items.Where(f => f.GoodCategoryID == goodCategory.ID))
            {
                var good = new ActionModel <GoodProperty>(item)
                {
                    Text        = item.Name,
                    Description = item.Description,
                    ExecAction  = async f => await EditGoodProperty(item)
                };

                good.AddLeftSwipe("Delete", Color.Red, new Command(async f => await DeleteGoodProperty(f as GoodProperty)));
                good.AddRightSwipe("Edit", Color.Yellow, new Command(async f => await EditGoodProperty(f as GoodProperty)));

                Elements.Add(good);
            }
        }
예제 #4
0
        public async Task Appearing()
        {
            var items = viewedGoodProperties;

            Elements.Clear();
            foreach (var property in items.GoodProperties)
            {
                var itemPropertyValue = items.GoodPropertyValues.Where(f => f.GoodPropertyID == property.ID).FirstOrDefault();

                var good = new ActionModel <GoodProperty>(property)
                {
                    Text        = property.Name,
                    Description = itemPropertyValue?.Value,
                    ExecAction  = async f => await EditGoodPropertyValue(property)
                };

                good.AddLeftSwipe("Delete", Color.Red, new Command(async f => await DeleteGoodPropertyValue(f as GoodProperty)));
                good.AddRightSwipe("Edit", Color.Yellow, new Command(async f => await EditGoodPropertyValue(f as GoodProperty)));
                //Предложить поставить значение?

                Elements.Add(good);
            }
        }