diff options
Diffstat (limited to 'Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs')
| -rw-r--r-- | Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs | 38 |
1 files changed, 5 insertions, 33 deletions
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(); |
