Example #1
0
        private void GradientBorder_MouseUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                if (_gradientPopupChild == null)
                {
                    _gradientPopupChild               = new GradientStops();
                    _gradientPopupChild.ParentPopup   = popupGradient;      // doing this so it can set StaysOpen when it spawns its own child
                    _gradientPopupChild.ValueChanged += new EventHandler(GradientPopupChild_ValueChanged);

                    popupGradient.Child = _gradientPopupChild;
                }

                popupGradient.Placement        = PlacementMode.Relative;
                popupGradient.PlacementTarget  = canvasGradient;
                popupGradient.VerticalOffset   = 0;
                popupGradient.HorizontalOffset = canvasGradient.ActualWidth + 15;

                this.IsPopupShowing  = true;
                popupGradient.IsOpen = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), TITLE, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Example #2
0
        private void StoreGradient(GradientEntry[] gradient)
        {
            if (_gradientPopupChild == null)
            {
                _gradientPopupChild               = new GradientStops();
                _gradientPopupChild.ParentPopup   = popupGradient;      // doing this so it can set StaysOpen when it spawns its own child
                _gradientPopupChild.ValueChanged += new EventHandler(GradientPopupChild_ValueChanged);

                popupGradient.Child = _gradientPopupChild;
            }

            //NOTE: These will raise events
            chkGradient.IsChecked = gradient != null && gradient.Length > 0;
            _gradientPopupChild.StoreSelection(gradient);
        }
        private void StoreGradient(Tuple<double, double>[] gradient)
        {
            if (_gradientPopupChild == null)
            {
                _gradientPopupChild = new GradientStops();
                _gradientPopupChild.ParentPopup = popupGradient;        // doing this so it can set StaysOpen when it spawns its own child
                _gradientPopupChild.ValueChanged += new EventHandler(GradientPopupChild_ValueChanged);

                popupGradient.Child = _gradientPopupChild;
            }

            //NOTE: These will raise events
            chkGradient.IsChecked = gradient != null && gradient.Length > 0;
            _gradientPopupChild.StoreSelection(gradient);
        }
        private void GradientBorder_MouseUp(object sender, MouseButtonEventArgs e)
        {
            try
            {
                if (_gradientPopupChild == null)
                {
                    _gradientPopupChild = new GradientStops();
                    _gradientPopupChild.ParentPopup = popupGradient;        // doing this so it can set StaysOpen when it spawns its own child
                    _gradientPopupChild.ValueChanged += new EventHandler(GradientPopupChild_ValueChanged);

                    popupGradient.Child = _gradientPopupChild;
                }

                popupGradient.Placement = PlacementMode.Relative;
                popupGradient.PlacementTarget = canvasGradient;
                popupGradient.VerticalOffset = 0;
                popupGradient.HorizontalOffset = canvasGradient.ActualWidth + 15;

                this.IsPopupShowing = true;
                popupGradient.IsOpen = true;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), TITLE, MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }