diff options
| author | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
|---|---|---|
| committer | Mirta <mirta@twine-s.com> | 2020-12-30 16:39:52 +0200 |
| commit | 00a491d93733d4625ad329b2ba8237f445364b3f (patch) | |
| tree | 4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/SideChains/RealTimeGraphX-master/RealTimeGraphX.WPF/WpfGraphAxisControl.cs | |
| parent | 124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff) | |
| download | Tango-00a491d9.tar.gz Tango-00a491d9.zip | |
merge
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(); |
