/// <summary>
        /// Handles a point color changing.
        /// </summary>
        /// <param name="sender">Sender.</param>
        partial void PointColorChanged(Foundation.NSObject sender)
        {
            // Save undo point
            DesignSurface.SaveUndoPoint();

            // Get color components
            nfloat red, green, blue, alpha;

            PointColor.Color.GetRgba(out red, out green, out blue, out alpha);

            // Set new color and inform caller
            SelectedGradient.SelectedHandle.Color = new SKColor((byte)(red * 255),
                                                                (byte)(green * 255),
                                                                (byte)(blue * 255),
                                                                (byte)(OpacitySlider.IntValue));

            // Update UI
            DesignPreview.RefreshView();
            DesignBar.RefreshView();
            RaiseGradientModified(SelectedGradient);
            RaiseShapeModified();
        }
        /// <summary>
        /// Handles the linked color changing.
        /// </summary>
        /// <param name="sender">Sender.</param>
        partial void LinkedColorChanged(Foundation.NSObject sender)
        {
            // Save undo point
            DesignSurface.SaveUndoPoint();

            // Take action based on the item selected
            if (LinkedColorDropdown.IndexOfSelectedItem == 0)
            {
                // None selected
                SelectedGradient.SelectedHandle.LinkedColor = null;
            }
            else
            {
                // Base this color off of another color
                SelectedGradient.SelectedHandle.LinkedColor = Portfolio.Colors[(int)LinkedColorDropdown.IndexOfSelectedItem - 1];
            }

            // Update UI
            DesignPreview.RefreshView();
            DesignBar.RefreshView();
            ShowCurrentColor();
            RaiseShapeModified();
        }
Ejemplo n.º 3
0
        void ReleaseDesignerOutlets()
        {
            if (DesignPreview != null)
            {
                DesignPreview.Dispose();
                DesignPreview = null;
            }

            if (AddColorButton != null)
            {
                AddColorButton.Dispose();
                AddColorButton = null;
            }

            if (AddPointButton != null)
            {
                AddPointButton.Dispose();
                AddPointButton = null;
            }

            if (BackButton != null)
            {
                BackButton.Dispose();
                BackButton = null;
            }

            if (DeleteButton != null)
            {
                DeleteButton.Dispose();
                DeleteButton = null;
            }

            if (DeletePointButton != null)
            {
                DeletePointButton.Dispose();
                DeletePointButton = null;
            }

            if (DesignBar != null)
            {
                DesignBar.Dispose();
                DesignBar = null;
            }

            if (DuplicateButton != null)
            {
                DuplicateButton.Dispose();
                DuplicateButton = null;
            }

            if (DuplicatePointButton != null)
            {
                DuplicatePointButton.Dispose();
                DuplicatePointButton = null;
            }

            if (GradientName != null)
            {
                GradientName.Dispose();
                GradientName = null;
            }

            if (LinkedColorDropdown != null)
            {
                LinkedColorDropdown.Dispose();
                LinkedColorDropdown = null;
            }

            if (OpacitySlider != null)
            {
                OpacitySlider.Dispose();
                OpacitySlider = null;
            }

            if (OpacityValue != null)
            {
                OpacityValue.Dispose();
                OpacityValue = null;
            }

            if (PointColor != null)
            {
                PointColor.Dispose();
                PointColor = null;
            }

            if (SelectedColorTitle != null)
            {
                SelectedColorTitle.Dispose();
                SelectedColorTitle = null;
            }

            if (TileDropdown != null)
            {
                TileDropdown.Dispose();
                TileDropdown = null;
            }

            if (TypeDropdown != null)
            {
                TypeDropdown.Dispose();
                TypeDropdown = null;
            }

            if (RadiusSlider != null)
            {
                RadiusSlider.Dispose();
                RadiusSlider = null;
            }

            if (RadiusValue != null)
            {
                RadiusValue.Dispose();
                RadiusValue = null;
            }
        }