Пример #1
0
 private void RestoreDataContext()
 {
     if (this.cachedDataContext == null)
     {
         return;
     }
     this.cachedDataContext.RestoreSceneViewAdorners();
     this.cachedDataContext = (GradientBrushEditor)null;
 }
Пример #2
0
        private void AddGradientStop(object sender, ExecutedRoutedEventArgs eventArgs)
        {
            GradientBrushEditor gradientBrushEditor = (GradientBrushEditor)this.DataContext;

            if (gradientBrushEditor == null)
            {
                return;
            }
            gradientBrushEditor.AddGradientStop((IInputElement)this, RoundingHelper.RoundScale((double)eventArgs.Parameter));
        }
Пример #3
0
        private void RestoreGradientStop(object sender, ExecutedRoutedEventArgs eventArgs)
        {
            GradientBrushEditor gradientBrushEditor = (GradientBrushEditor)this.DataContext;

            if (gradientBrushEditor == null)
            {
                return;
            }
            gradientBrushEditor.RestoreGradientStop((IInputElement)this);
        }
Пример #4
0
        public void AddGradientStop(IInputElement sender, double offset)
        {
            SceneView defaultView = this.BasisProperty.SceneNodeObjectSet.ViewModel.DefaultView;
            object    obj         = this.gradientStopsProperty.GetValue();
            GradientStopCollection gradientStops = (GradientStopCollection)defaultView.ConvertToWpfValue(obj);

            if (gradientStops == null)
            {
                gradientStops = new GradientStopCollection();
                this.gradientStopsProperty.SetValue(defaultView.ConvertFromWpfValue((object)gradientStops));
            }
            Color color = GradientBrushEditor.CalculateColor(gradientStops, offset);

            this.gradientStopsProperty.AddValue(defaultView.ConvertFromWpfValue((object)new GradientStop(color, offset)));
            this.RebuildModel(-1);
        }