public ProductCommentsViewModel() { ProductDisplayed = new Product() { Name = "Bolacha Maria" }; UserRatings = new ObservableCollection<UserRating>(); UserRatings.Add(new UserRating(){ Id="1", Like = true, Comment="Me fez super bem", Profile=EnumProfile.Lactose, User=new User(){ Id="1", Name="Zé Carioca", Profiles = EnumProfile.Lactose | EnumProfile.Wheat } }); UserRatings.Add (new UserRating () { Id = "21", Like = true, Comment = "Gostei do produto sem lactose", Profile = EnumProfile.Lactose, User = new User () { Id = "21", Name = "Zé Colméia", Profiles = EnumProfile.Lactose | EnumProfile.Wheat } }); }
public async System.Threading.Tasks.Task NavigateToProductDetail(Product product) { var view = new Views.ProductDetailView (); SetViewModelParameter (product, view); await FazBem.App.Current.MainPage.Navigation.PushAsync(view); }
private Product CreateProduct3() { var product = new Product { BarCode = "894375982374", Id = "3", Name = "Marmite" }; product.Comments.Add(new ProductComment { Author = "Wirth", Text = "Love or hate" }); product.Comments.Add(new ProductComment { Author = "Sato", Text = "Prefiro sushi" }); product.Comments.Add(new ProductComment { Author = "Maurício", Text = "Hein?" }); return product; }
private Product CreateProduct2() { var product = new Product { BarCode = "230948920384", Id = "2", Name = "Skol" }; product.Comments.Add(new ProductComment { Author = "Maycon", Text = "Desce redondo" }); product.Comments.Add(new ProductComment { Author = "Wellington", Text = "Feito com milho trangenico" }); product.Comments.Add(new ProductComment { Author = "Maurício", Text = "Sem coco durinho" }); return product; }
private Product CreateProduct1() { var product = new Product { BarCode = "99283498723984", Id = "1", Name = "Bolacha Maria" }; product.Comments.Add(new ProductComment { Author = "Wirth", Text = "Produto realmente sem lactose" }); product.Comments.Add(new ProductComment { Author = "Sato", Text = "Bom produto" }); product.Comments.Add(new ProductComment { Author = "Maurício", Text = "Coco durinho" }); return product; }
/// <summary> /// Takes the picture. /// </summary> /// <returns>Take Picture Task.</returns> private async void TakePicture() { /*Setup(); ImageSource = null; return await _mediaPicker.TakePhotoAsync(new CameraMediaStorageOptions { DefaultCamera = CameraDevice.Front, MaxPixelDimension = 400 }).ContinueWith(t => { if (t.IsFaulted) { Status = t.Exception.InnerException.ToString(); } else if (t.IsCanceled) { Status = "Canceled"; } else { var mediaFile = t.Result; ImageSource = ImageSource.FromStream(() => mediaFile.Source); _navigationService.NavigateToProductDetail(); return mediaFile; } return null; }, _scheduler);*/ var scanner = new ZXing.Mobile.MobileBarcodeScanner (); var result = await scanner.Scan(); if (result != null) { await _messageService.ShowAsync ("Scanned Barcode: " + result.Text); Product product = new Product () { BarCode = result.Text }; await _navigationService.NavigateToProductDetail (product); } else await _messageService.ShowAsync ("Failed trying to scan the product"); }
public ProductCommentsViewModel(Product product, IList UserRatings) { }