diff options
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF')
5 files changed, 8 insertions, 65 deletions
diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/Themes/Generic.xaml b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/Themes/Generic.xaml index 64145bcfa..1070736ef 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/Themes/Generic.xaml +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/Themes/Generic.xaml @@ -34,7 +34,7 @@ <ItemsControl x:Name="PART_ItemsControl" ItemsSource="{TemplateBinding Items}" ItemTemplate="{TemplateBinding ItemTemplate}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> - <local:WpfGraphAxisPanel x:Name="PART_AxisPanel" Orientation="{Binding RelativeSource={RelativeSource AncestorType=local:WpfGraphAxisControl},Path=Orientation}"></local:WpfGraphAxisPanel> + <local:WpfGraphAxisPanel Orientation="{Binding RelativeSource={RelativeSource AncestorType=local:WpfGraphAxisControl},Path=Orientation}"></local:WpfGraphAxisPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs index aa738b203..23b831abe 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs @@ -25,7 +25,6 @@ namespace RealTimeGraphX.WPF public class WpfGraphAxisControl : WpfGraphComponentBase { private ItemsControl _items_control; - private WpfGraphAxisPanel _axisPanel; /// <summary> /// Initializes the <see cref="WpfGraphAxisControl"/> class. @@ -98,37 +97,9 @@ namespace RealTimeGraphX.WPF base.OnApplyTemplate(); _items_control = GetTemplateChild("PART_ItemsControl") as ItemsControl; - - _items_control.Loaded += (x, e) => - { - ItemsPresenter itemsPresenter = GetVisualChild<ItemsPresenter>(_items_control); - _axisPanel = VisualTreeHelper.GetChild(itemsPresenter, 0) as WpfGraphAxisPanel; - }; - OnTicksChanged(); } - private static T GetVisualChild<T>(DependencyObject parent) where T : Visual - { - T child = default(T); - - int numVisuals = VisualTreeHelper.GetChildrenCount(parent); - for (int i = 0; i < numVisuals; i++) - { - Visual v = (Visual)VisualTreeHelper.GetChild(parent, i); - child = v as T; - if (child == null) - { - child = GetVisualChild<T>(v); - } - if (child != null) - { - break; - } - } - return child; - } - /// <summary> /// Called when the <see cref="Ticks"/> property has changed. /// </summary> @@ -136,15 +107,16 @@ namespace RealTimeGraphX.WPF { Items = new ObservableCollection<WpfGraphAxisTickData>(Enumerable.Range(0, Ticks).Select(x => new WpfGraphAxisTickData())); - Controller?.RequestVirtualRangeChange(); - - _axisPanel?.UpdatePanel(); + if (Controller != null) + { + Controller.RequestVirtualRangeChange(); + } } protected override void OnControllerChanged(IGraphController oldController, IGraphController newController) { base.OnControllerChanged(oldController, newController); - + if (newController != null) { newController.RequestVirtualRangeChange(); diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisPanel.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisPanel.cs index 4fb6d94bc..f10b583f4 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisPanel.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisPanel.cs @@ -46,7 +46,7 @@ namespace RealTimeGraphX.WPF /// <summary> /// Updates the panel. /// </summary> - public void UpdatePanel() + private void UpdatePanel() { RowDefinitions.Clear(); ColumnDefinitions.Clear(); diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphDataSeries.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphDataSeries.cs index 8eab3eabe..15a99ab54 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphDataSeries.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphDataSeries.cs @@ -135,15 +135,5 @@ namespace RealTimeGraphX.WPF { get { return Fill != null; } } - - private object _currentValue; - /// <summary> - /// Gets the current value. - /// </summary> - public object CurrentValue - { - get { return _currentValue; } - set { _currentValue = value; RaisePropertyChangedAuto(); } - } } } diff --git a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphSurface.cs b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphSurface.cs index 1a3015728..ebcff3472 100644 --- a/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphSurface.cs +++ b/Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphSurface.cs @@ -40,20 +40,6 @@ namespace RealTimeGraphX.WPF private Point _last_mouse_position; private Grid _grid; - #region Events - - /// <summary> - /// Occurs when the surface size has changed. - /// </summary> - public event EventHandler SurfaceSizeChanged; - - /// <summary> - /// Occurs when the surface zoom rectangle has changed. - /// </summary> - public event EventHandler ZoomRectChanged; - - #endregion - #region Properties /// <summary> @@ -191,8 +177,6 @@ namespace RealTimeGraphX.WPF } _zoom_rect = new System.Drawing.RectangleF((float)x, (float)y, _zoom_rect.Width, _zoom_rect.Height); - - ZoomRectChanged?.Invoke(this, new EventArgs()); } _last_mouse_position = _current_mouse_position; @@ -218,7 +202,6 @@ namespace RealTimeGraphX.WPF _zoom_rect = new System.Drawing.RectangleF((float)Canvas.GetLeft(_selection_rectangle), (float)Canvas.GetTop(_selection_rectangle), (float)_selection_rectangle.Width, (float)_selection_rectangle.Height); _selection_rectangle.Visibility = Visibility.Hidden; _is_scaled = true; - ZoomRectChanged?.Invoke(this, new EventArgs()); } } @@ -239,7 +222,6 @@ namespace RealTimeGraphX.WPF { _zoom_rect = new System.Drawing.RectangleF(); _is_scaled = false; - ZoomRectChanged?.Invoke(this, new EventArgs()); } else if (Keyboard.IsKeyDown(Key.LeftCtrl)) { @@ -319,7 +301,7 @@ namespace RealTimeGraphX.WPF /// <param name="points">The points.</param> public void DrawSeries(WpfGraphDataSeries dataSeries, IEnumerable<System.Drawing.PointF> points) { - _g.DrawPolygon(dataSeries.GdiPen, points.ToArray()); + _g.DrawCurve(dataSeries.GdiPen, points.ToArray()); } /// <summary> @@ -391,7 +373,6 @@ namespace RealTimeGraphX.WPF { _size = new System.Drawing.SizeF((float)e.NewSize.Width, (float)e.NewSize.Height); _size_changed = true; - SurfaceSizeChanged?.Invoke(this, new EventArgs()); } #endregion |
