Ejemplo n.º 1
0
        private void UpdateSizeSelection(SelectedSize selectedSize)
        {
            Xamarin.Forms.Shapes.Rectangle selectedRect = SmallRect;
            Xamarin.Forms.Shapes.Path      selectedCup  = SmallCup;
            switch (selectedSize)
            {
            case SelectedSize.small:
                selectedRect = SmallRect;
                selectedCup  = SmallCup;
                break;

            case SelectedSize.medium:
                selectedRect = MediumRect;
                selectedCup  = MediumCup;
                break;

            case SelectedSize.large:
                selectedRect = LargeRect;
                selectedCup  = LargeCup;
                break;
            }

            // clear the selections
            SolidColorBrush unselectedBackground = new SolidColorBrush(Color.FromHex("F8F8F8"));
            SolidColorBrush unselectedStroke     = new SolidColorBrush(Color.FromHex("E1E1E1"));
            SolidColorBrush selectedBackground   = new SolidColorBrush(Color.FromHex("E5F0EC"));
            SolidColorBrush selectedStroke       = new SolidColorBrush(Color.FromHex("1B714B"));

            SmallRect.Fill    = unselectedBackground;
            SmallRect.Stroke  = unselectedStroke;
            MediumRect.Fill   = unselectedBackground;
            MediumRect.Stroke = unselectedStroke;
            LargeRect.Fill    = unselectedBackground;
            LargeRect.Stroke  = unselectedStroke;
            SmallCup.Stroke   = unselectedStroke;
            MediumCup.Stroke  = unselectedStroke;
            LargeCup.Stroke   = unselectedStroke;

            // move the selectionRectangle
            SelectionRect.LayoutTo(selectedRect.Bounds, 100, Easing.CubicInOut);

            // update the background colors
            selectedRect.Fill = selectedBackground;

            // update the stroke on the cup
            selectedCup.Stroke = selectedStroke;
        }
Ejemplo n.º 2
0
        private void UpdateSizeSelectionMyVersion(Xamarin.Forms.Shapes.Rectangle border, Xamarin.Forms.Shapes.Path cup)
        {
            // clear the selections
            SolidColorBrush unselectedBackground = new SolidColorBrush(Color.FromHex("F8F8F8"));
            SolidColorBrush unselectedStroke     = new SolidColorBrush(Color.FromHex("E1E1E1"));
            SolidColorBrush selectedBackground   = new SolidColorBrush(Color.FromHex("E5F0EC"));
            SolidColorBrush selectedStroke       = new SolidColorBrush(Color.FromHex("1B714B"));

            SmallRect.Fill    = unselectedBackground;
            SmallRect.Stroke  = unselectedStroke;
            MediumRect.Fill   = unselectedBackground;
            MediumRect.Stroke = unselectedStroke;
            LargeRect.Fill    = unselectedBackground;
            LargeRect.Stroke  = unselectedStroke;
            SmallCup.Stroke   = unselectedStroke;
            MediumCup.Stroke  = unselectedStroke;
            LargeCup.Stroke   = unselectedStroke;

            // move the selectionRectangle
            SelectionRect.LayoutTo(border.Bounds, 100, Easing.CubicInOut);

            // update the background colors
            border.Fill = selectedBackground;

            // update the stroke on the cup
            cup.Stroke = selectedStroke;
        }