diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-29 18:45:10 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-01-29 18:45:10 +0200 |
| commit | 5cda8b0a3ab579dd6f33b1cb19a1d295dc661d28 (patch) | |
| tree | ef9408ca50840d407f3c62bbcd19147739fde145 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs | |
| parent | 7e8ff4c3ca798d426eb6f381c5312a747f1bb800 (diff) | |
| download | Tango-5cda8b0a3ab579dd6f33b1cb19a1d295dc661d28.tar.gz Tango-5cda8b0a3ab579dd6f33b1cb19a1d295dc661d28.zip | |
Added gradient display of color Brush Stops.
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs index c4e853433..52febe37b 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml.cs @@ -14,6 +14,7 @@ using System.Windows.Navigation; using System.Windows.Shapes; using Tango.DAL.Observables; using Tango.DragAndDrop; +using Tango.MachineStudio.Developer.Converters; using Tango.MachineStudio.Developer.ViewModels; namespace Tango.MachineStudio.Developer.Views @@ -43,7 +44,7 @@ namespace Tango.MachineStudio.Developer.Views _vm = DataContext as MainViewVM; }; - chkGraphs.Checked += (x, y) => { graphRowDefinition.Height = new GridLength(161, GridUnitType.Star); }; + chkGraphs.Checked += (x, y) => { graphRowDefinition.Height = new GridLength(440, GridUnitType.Pixel); }; chkGraphs.Unchecked += (x, y) => { graphRowDefinition.Height = new GridLength(80, GridUnitType.Pixel); }; } @@ -54,5 +55,42 @@ namespace Tango.MachineStudio.Developer.Views _vm.OnDropAvailableSensor(e.Draggable.DataContext as Sensor); } } + + private void ColorPickerCombo_SelectedColorChanged(object sender, RoutedPropertyChangedEventArgs<Color?> e) + { + UpdateGradientBrushDisplay(); + } + + private void Offset_Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) + { + UpdateGradientBrushDisplay(); + } + + private void UpdateGradientBrushDisplay() + { + if (_vm.SelectedSegment != null) + { + SegmentToGradientStopsConverter converter = new SegmentToGradientStopsConverter(); + GradientStopCollection stops = converter.Convert(_vm.SelectedSegment, null, null, null) as GradientStopCollection; + gradientBrush.GradientStops = stops; + } + else + { + gradientBrush.GradientStops = new GradientStopCollection(); + } + } + + private void OnBrushStopBorderDrop(object sender, DropEventArgs e) + { + if (e.Draggable.DataContext is BrushStop) + { + _vm.OnDropBrushStop(e.Draggable.DataContext as BrushStop, e.Droppable.DataContext as BrushStop); + } + } + + private void ListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) + { + UpdateGradientBrushDisplay(); + } } } |
