Example #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);
        }
Example #2
0
 /// <summary>
 /// Перейти к странице
 /// </summary>
 public async Task NavigateTo(IClothesDetailDomain clothesDetail, SizeType defaultSizeType) =>
 await NavigateTo(new ClothesDetailNavigationParameters(clothesDetail, defaultSizeType));
 public ClothesDetailNavigationParameters(IClothesDetailDomain clothesDetail, SizeType defaultSizeType)
 {
     ClothesDetail   = clothesDetail;
     DefaultSizeType = defaultSizeType;
 }