Пример #1
0
 private void answerClosing(object sender, object e)
 {
     answersToClose--;
     if (answersToClose == 0)
     {
         closing = false;
         if (possibleProducts.Count == 1)
         {
             //Storyboards.DissapearLeft(rootGrid, toLoadingPage);
             timer.Stop();
             answersGrid.Visibility = Visibility.Collapsed;
             Storyboards.FadeOut(dotImage, FadeOutTime, toLoadingPage);
             Storyboards.FadeOut(backButton, FadeOutTime, null);
             Storyboards.FadeOut(infoImage, FadeOutTime, null);
             Storyboards.FadeOut(questionOuterCircle, FadeOutTime, null);
             if (infoBox.Opacity > 0)
             {
                 Storyboards.Fade(infoBox, FadeOutTime, infoBox.Opacity, 0, null);
             }
             App.SelectedProduct = possibleProducts[0];
         }
         else
         {
             showQuestion(questionId + 1);
         }
     }
 }
Пример #2
0
        private void selectProduct(int id)
        {
            if (animating || id == currentProduct)
            {
                return;
            }
            animating      = true;
            currentProduct = id;
            Storyboards.Fade(productImages[lastProduct], FadeTime, 0.5, 1, null);
            Storyboards.FadeOut(centerGrid, FadeTime / 2, fadeInNewProduct);
            setUsersImage();
            if (currentProduct == 0)
            {
                Storyboards.FadeIn(assetImages[0], AppearTime, null);
            }

            for (int i = 2; i < NrOfAssets; i++)
            {
                bool hasFeature = ProductFeatures[currentProduct][i - 2];
                assetImages[i].Source  = hasFeature ? colorAssetSource[i] : grayAssetSource[i];
                assetImages[i].Opacity = hasFeature ? 1.0 : GrayedOpacity;
            }

            setInfoBoxText(id);
            showAssets();
            waveAssets();

            lastProduct = currentProduct;
            Storyboards.Fade(productImages[currentProduct], FadeTime, 1, 0.5, doneAnimating);
        }
Пример #3
0
 private void compare365And2016(object sender, TappedRoutedEventArgs e)
 {
     if (compareTransition)
     {
         return;
     }
     compareTransition = true;
     compareMode       = CompareMode.Compare2;
     Storyboards.FadeOut(comparisonChart, FadeTime, showCompare2);
 }
Пример #4
0
 private void compareHomeAndPersonal(object sender, TappedRoutedEventArgs e)
 {
     if (compareTransition)
     {
         return;
     }
     compareTransition = true;
     compareMode       = CompareMode.Compare1;
     Storyboards.FadeOut(comparisonChart, FadeTime, showCompare1);
 }
Пример #5
0
        private void closeAnswers(object sender, object e)
        {
            //Debug.WriteLine("Close Answers Animation.");
            int phase = 0;

            Storyboards.FadeOut(questionTextBlock, AnswerPopInTime, null);
            foreach (Grid child in answersGrid.Children)
            {
                double radius = App.QuestionsOuterCircleDiameter / 2;
                Storyboards.MoveX(child, AnswersXOffset * radius, -radius, CloseAnswerPopOutTime + phase, answerClosing);
                phase += CloseAnswerPopOutPhase;
            }
        }
Пример #6
0
        private void combineCenterGrids(object sender, object e)
        {
            centerGridAnimating   = true;
            centerGridShowCompare = false;
            double toX = -App.Width * xShift;
            double toY = -App.Height * yShift;

            Storyboards.MoveXY(subscriptionVsOneTimeGrid, CenterGridSplitTime, -toX * xShiftCompareFactor, toY, 0, toY, finishCenterGridAnimation);
            if (useScalingOnCenterGridAnimation)
            {
                Storyboards.MoveXYAndScale(centerGrid, CenterGridSplitTime, toX, toY, 0, toY, CenterGridScaleUp, CenterGridScaleUpTime, null);
            }
            else
            {
                Storyboards.MoveXY(centerGrid, CenterGridSplitTime, toX, toY, 0, toY, null);
            }
            Storyboards.FadeOut(subscriptionVsOneTimeGrid, CenterGridSplitTime, null);
        }
Пример #7
0
 private void hideInfoBox(object sender, TappedRoutedEventArgs e)
 {
     Storyboards.FadeOut(infoBox, AppearTime, collapseInfoBox);
     Storyboards.FadeIn(infoIcon, AppearTime, null);
     infoIcon.Visibility = Visibility.Visible;
 }
Пример #8
0
        private void showAssetDetails(object sender, TappedRoutedEventArgs e)
        {
            if (featuresDetailsMode)
            {
                return;
            }
            Storyboards.FadeIn(featuresDetails, AppearTime / 2, showProductiInfoGrid);
            Storyboards.AppearBottom(featuresDetails, AppearTime / 2, null);
            learnMore365Button.Opacity = 0;
            productInfoGrid.Opacity    = 0;

            featuresDetailsMode = true;
            useScaleTargets     = true;
            Storyboards.FadeOut(aUsersText, FadeTime, null);
            Storyboards.FadeOut(aDeviceText, FadeTime, null);

            // TODO Rework this section
            for (int i = 0; i < NrOfAssets; i++)
            {
                var    transform = assetDummy[i].TransformToVisual(Window.Current.Content);
                Point  absolutePosition = transform.TransformPoint(new Point(0, 0));
                double ff = 1.0, xoff = 0;
                double size       = App.AssetDummySize;
                double originSize = aImgSize;
                if (i == 0)   // Ignore?
                {
                    size = App.AssetDummySizeUser;
                    xoff = size * 0.2;
                    ff   = 0.85;
                }
                else if (i == 1)
                {
                    size = App.AssetDummySizeDevice * 1.2;
                    xoff = currentProduct > 1 ? 0: size * 0.1;
                    ff   = 0.75;
                }
                double scale = size / originSize;
                xyScaleTargets[i].X = scale;
                xyScaleTargets[i].Y = scale;
                xyTargets[i].X      = absolutePosition.X + (scale - 1.0) * size / 4 + xoff;
                xyTargets[i].Y      = -App.Height + absolutePosition.Y + size * ff;
            }

            double x = xyTargets[1].X;

            if (currentProduct == 1)
            {
                x *= 0.75;
            }
            else if (currentProduct == 0)
            {
                x *= 0.9;
            }
            xyTargets[0].X = x;
            xyTargets[0].Y = xyTargets[1].Y - App.AssetDummySizeDevice / 1.7;

            loadSources();
            if (currentProduct == 0)
            {
                aDevice.Source = homeDevices;
                homeDevices.Stop();
                homeDevices.Play();
            }
            else if (currentProduct == 1)
            {
                aDevice.Source = personalDevices;
                personalDevices.Stop();
                personalDevices.Play();
            }
            else
            {
                aDevice.Source = singleDevice;
                singleDevice.Stop();
                singleDevice.Play();
            }
        }
Пример #9
0
        private void cgReleased(object sender, PointerRoutedEventArgs e)
        {
            dbg("Release - enter");

            if (dragging)
            {
                centerGrid.ReleasePointerCapture(e.Pointer);
                e.Handled = true;
                dragging  = false;
                dbg("Release - dragging handled");
            }
            else
            {
                dbg("Release - not dragging - return");
                return;
            }

            if (centerGridAnimating)
            {
                dbg("Release - return: move = " + cgMoving + " / animate = " + centerGridAnimating);
                return;
            }
            PointerPoint pp = e.GetCurrentPoint(this);

            cgTargetRotation = 0;
            dbg("Release - is move || animate");

            if (startX == pp.Position.X && startY == pp.Position.Y)
            {
                dbg("Release - toggle and return");
                toggleCenterGrid();
                return;
            }

            CompositeTransform ct  = centerGrid.RenderTransform as CompositeTransform;
            double             toX = -App.Width * xShift;
            double             toY = -App.Height * yShift;

            centerGridAnimating = true;
            cgMoving            = true;
            dbg("Release - compare = " + centerGridShowCompare);
            if (centerGridShowCompare)
            {
                Storyboards.MoveXY(subscriptionVsOneTimeGrid, CenterGridSplitTime, -toX * xShiftCompareFactor, toY, 0, toY, null);
                Storyboards.FadeOut(subscriptionVsOneTimeGrid, CenterGridSplitTime, finishCenterGridAnimation);
                dbg("Release - cgTargetX = " + cgTargetX);

                /*if (cgTransform != null && Math.Abs(cgTargetX) < 5) {
                 *  dbg("Release Point - set TranslateX" + toX);
                 *  cgTransform.TranslateX = toX;
                 *  cgTransform.TranslateY = toY;
                 * }*/
                cgTargetX             = 0;
                cgTargetY             = toY;
                centerGridShowCompare = false;
                dbg("Release - hide compare");
            }
            else
            {
                Storyboards.MoveXY(subscriptionVsOneTimeGrid, CenterGridSplitTime, 0, toY, -toX * xShiftCompareFactor, toY, null);
                Storyboards.FadeIn(subscriptionVsOneTimeGrid, CenterGridSplitTime, finishCenterGridAnimation);
                dbg("Release - cgTargetX = " + cgTargetX);

                /*if (cgTransform != null && Math.Abs(cgTargetX) < 5) {
                 *  dbg("Release Point - set TranslateX = 0");
                 *  cgTransform.TranslateX = 0;
                 *  cgTransform.TranslateY = toY;
                 * }*/
                cgTargetX             = toX;
                cgTargetY             = toY;
                centerGridShowCompare = true;
                dbg("Release - show compare");
            }
        }
Пример #10
0
        public ProductPage()
        {
            Debug.WriteLine("Production Page.");

            this.InitializeComponent();
            this.Width  = Double.NaN;
            this.Height = Double.NaN;

            for (int i = 0; i < 6; i++)
            {
                string str = (i + 1).ToString();
                productName[i] = App.ResourceLoader.GetString("Product" + str);
                productInfoBoxDescription[i] = App.ResourceLoader.GetString("ProductInfoDescription" + str);
                productInfoBoxName[i]        = App.ResourceLoader.GetString("ProductTitle" + str);
                productDeviceInfo[i]         = App.ResourceLoader.GetString("ProductDeviceInfo" + str);
                productDeviceTitle[i]        = App.ResourceLoader.GetString("ProductDeviceTitle" + str);
            }

            assetDummy      = new Image[] { dummyUsers, dummyDevice, aDummy1, aDummy2, aDummy3, aDummy4, aDummy5, aDummy6, aDummy7, aDummy8, aDummy9, aDummy10 };
            comparisonGrids = new Grid[] { comparisonGrid0, comparisonGrid1, comparisonGrid3, comparisonGrid2, comparisonGrid5, comparisonGrid4 };
            //comparisonImages = new Image[] { comparisonImage0, comparisonImage1, comparisonImage2, comparisonImage3, comparisonImage4, comparisonImage5 };
            productImages    = new Image[] { pImg1, pImg2, pImg3, pImg4, pImg5, pImg6 };
            assetImages      = new Image[] { aUsers, aDevice, aImg1, aImg2, aImg3, aImg4, aImg5, aImg6, aImg7, aImg8, aImg9, aImg10 };
            NrOfAssets       = assetImages.Length;
            NrOfProducts     = productName.Length;
            xyTargets        = new Point[NrOfAssets];
            xyScaleTargets   = new Point[NrOfAssets];
            colorAssetSource = new ImageSource[NrOfAssets];
            grayAssetSource  = new ImageSource[NrOfAssets];

            for (int i = 0; i < NrOfAssets; i++)
            {
                colorAssetSource[i] = assetImages[i].Source;
                if (i >= 2)
                {
                    grayAssetSource[i] = (ImageSource)Application.Current.Resources["GrayAsset" + (i - 1)];
                }
                assetDummy[i].Opacity          = 0.0;
                assetImages[i].RenderTransform = new CompositeTransform();
                assetImages[i].Tag             = i;
                xyTargets[i]      = new Point();
                xyScaleTargets[i] = new Point(1, 1);
            }

            homeButton.Opacity       = 0;
            infoIcon.Opacity         = 0;
            whatsIncludedBtn.Opacity = 0;
            video.Opacity            = 0;
            centerGrid.Opacity       = 0;
            productsPanel.Visibility = Visibility.Collapsed;

            centerVideo();
            video.Source = MediaSource.CreateFromUri(new Uri((String)Application.Current.Resources["CircleFlipVideo"]));
            mediaplayer  = video.MediaPlayer;
            mediaplayer.Play();

            timer.Interval = TimeSpan.FromMilliseconds(Interval);
            timer.Tick    += Timer_Tick;
            timer.Start();

            if (App.SelectedProduct >= 0)
            {
                currentProduct = App.SelectedProduct;
                lastProduct    = currentProduct;
            }
            productImage.Source = productImages[currentProduct].Source;
            productTitle.Text   = productName[currentProduct];
            productImages[currentProduct].Opacity = 0.5;
            setProductHeader();
            setUsersImage();

            infoBox.Visibility = Visibility.Collapsed;
            setInfoBoxText(currentProduct);

            subscriptionVsOneTimeGrid.Opacity = 0;

            App.productsPage = this;
            updatePositions();
            initAssets();

            // Slide in grids animation preparation / workaround
            assetDetails.Opacity    = 0;
            assetDetails.Visibility = Visibility.Visible;
            Storyboards.DissapearRight(assetDetails, restoreOpacity);
            comparisonGrid.Opacity    = 0;
            comparisonGrid.Visibility = Visibility.Visible;
            Storyboards.DissapearRight(comparisonGrid, null);
            featuresDetails.Opacity    = 0;
            featuresDetails.Visibility = Visibility.Visible;
            Storyboards.DissapearBottom(featuresDetails, 100, null);

            // Fade in video
            Storyboards.FadeIn(video, AppearTime * 2, null);
            if (FadeoutCircle)
            {
                Storyboards.FadeOut(questionCircle, AppearTime, null);
            }
            else
            {
                questionCircle.Opacity = 0;
            }
            FadeoutCircle = false;
        }
Пример #11
0
 private void infoBox_Tapped(object sender, TappedRoutedEventArgs e)
 {
     Storyboards.FadeOut(infoBox, AnswerPopInTime, infoBoxCollapse);
 }