public void Open(ProductItem productItem)
        {
            GeneralTransform productItemTransform = this.TransformToVisual(productItem);
            Point productItemPosition = productItemTransform.TransformPoint(new Point(0, ContentGrid.ActualHeight / 2));
            openPosition = -productItemPosition.Y + 19; // Measured offset just better looking animation.
            ((CompositeTransform)ContentGrid.RenderTransform).TranslateY = openPosition;
            FadeInSotryboard.Begin();
            isOpen = true;
            ContentGrid.IsHitTestVisible = isOpen;
            if (productItem.Product != null)
            {
                this.Product = productItem.Product;
                this.Bitmap = productItem.Bitmap;
            }

            PlWorkersCheck.Show(TimeSpan.FromSeconds(0.2));
            PlRndCheck.Show(TimeSpan.FromSeconds(0.3));
            PlRegisteredCheck.Show(TimeSpan.FromSeconds(0.4));
            PlNotGlobalCheck.Show(TimeSpan.FromSeconds(0.5));
        }
 public ProductEventArgs(Product product)
 {
     this.Product = product;
 }
 public ProductItem GetProductItem(Product product)
 {
     foreach (ProductItem productItem in RootGrid.Children)
         if (productItem.Product == product)
             return productItem;
     return null;
 }
 public ReportEventArgs(Product product, WriteableBitmap bitmap)
 {
     this.Product = product;
     this.Bitmap = bitmap;
 }
 /// <summary>
 /// The methods provided in this section are simply used to allow
 /// NavigationHelper to respond to the page's navigation methods.
 /// <para>
 /// Page specific logic should be placed in event handlers for the  
 /// <see cref="NavigationHelper.LoadState"/>
 /// and <see cref="NavigationHelper.SaveState"/>.
 /// The navigation parameter is available in the LoadState method 
 /// in addition to page state preserved during an earlier session.
 /// </para>
 /// </summary>
 /// <param name="e">Provides data for navigation methods and event
 /// handlers that cannot cancel the navigation request.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     this.navigationHelper.OnNavigatedTo(e);
     if (e.NavigationMode == NavigationMode.New && e.Parameter != null && e.Parameter is ReportEventArgs)
     {
         product = ((ReportEventArgs)e.Parameter).Product;
         WriteableBitmap bitmap = ((ReportEventArgs)e.Parameter).Bitmap;
         bitmap = bitmap.Rotate(90);
         photos.Add(new ReportPhoto(bitmap));
     }
     this.UpdateSendButtonAvaialbility();
 }
        private async void FindProduct()
        {
            product = await PolaClient.FindProduct(barcode);
            await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
            {
                ProgressBar.IsIndeterminate = false;

                if (product == null)
                {
                    TitleTextBlock.Text = "Brak informacji";
                    return;
                }

                if (product.PlScore != null)
                    ProgressBar.Value = (int)product.PlScore;


                TitleTextBlock.Text = product.Name;
                TitleTextBlock.Opacity = 1;
                //TitleTextBlock.Text = "Nieznany produkt (dotknij, aby zgłosić)";
                //TitleTextBlock.Text = "Brak informacji";

                switch (product.CardType)
                {
                    case CardType.White:
                        RootGrid.Background = PolaBrushes.ProductVerifiedBackground;
                        ProgressBar.Background = PolaBrushes.ProductVerifiedProgressBarBackground;
                        break;
                    case CardType.Grey:
                        RootGrid.Background = PolaBrushes.ProductNotVerifiedBackground;
                        ProgressBar.Background = PolaBrushes.ProductNotVerifiedProgressBarBackground;
                        break;
                }
            });
        }