Пример #1
0
        public ClothesViewModelItem(IClothesDetailDomain clothesDetail, IClothesTypeDomain clothesType,
                                    IClothesRestService clothesRestService,
                                    IClothesDetailNavigationService clothesDetailNavigationService)
        {
            ClothesDetail = clothesDetail;
            _clothesType  = clothesType;
            _clothesDetailNavigationService = clothesDetailNavigationService;
            _image = Observable.Return(ImageSource.FromFile("empty_image.png")).
                     ToProperty(this, nameof(Image));
            ImageCommand = ReactiveCommand.CreateFromTask(() => GetImageSource(clothesRestService, ClothesDetail.Id));
            _image       = ImageCommand.ToProperty(this, nameof(Image), scheduler: RxApp.MainThreadScheduler);
            this.WhenAnyValue(x => x.Image).
            Where(x => x != null).
            Subscribe(x => ImageLoad = true);

            ClothesDetailCommand = ReactiveCommand.CreateFromTask(ToClothesDetail);
        }
 /// <summary>
 /// Перейти к странице
 /// </summary>
 public async Task NavigateTo(GenderType genderType, IClothesTypeDomain clothesTypeDomain) =>
 await NavigateTo(new ClothesNavigationParameters(genderType, clothesTypeDomain));
 public ChoiceClothesTypeViewModelItem(IClothesTypeDomain clothesType)
 {
     ClothesType = clothesType;
 }
 /// <summary>
 /// Проверка наименования категории
 /// </summary>
 private static IResultError ValidateCategoryName(IClothesTypeDomain clothesType) =>
 clothesType.CategoryName.ToResultValueWhere(
     categoryName => !String.IsNullOrWhiteSpace(categoryName),
     _ => ModelsErrors.FieldNotValid <string, IClothesTypeDomain>(nameof(clothesType.CategoryName), clothesType));
 public ClothesNavigationParameters(GenderType genderType, IClothesTypeDomain clothesTypeDomain)
 {
     GenderType        = genderType;
     ClothesTypeDomain = clothesTypeDomain;
 }
Пример #6
0
 /// <summary>
 /// Получить сущность типа одежды
 /// </summary>
 private static ClothesTypeEntity GetClothesTypeEntity(IClothesTypeDomain clothesType) =>