Ejemplo n.º 1
0
        private void ConnectMaster()
        {
            if (!forceMasterField)
            {
                var element = VisualTreeHelper.GetParent(this);
                while (element != null && !(element is PlotBase))
                {
                    element = VisualTreeHelper.GetParent(element);
                }
                if (element != null)
                {
                    var newMaster = (PlotBase)element;

                    // Take plot-related properties from new master plot
                    IsInternalChange = true;
                    PlotOriginX      = newMaster.PlotOriginX;
                    PlotOriginY      = newMaster.PlotOriginY;
                    PlotWidth        = newMaster.PlotWidth;
                    PlotHeight       = newMaster.PlotHeight;
                    IsAutoFitEnabled = newMaster.IsAutoFitEnabled;
                    IsInternalChange = false;

                    masterField = newMaster;
                    masterField.AddDependant(this);
                    InvalidateBounds();
                }
            }
        }
Ejemplo n.º 2
0
        void HeatmapTooltipLayer_Loaded(object sender, RoutedEventArgs e)
        {
            var visualParent = VisualTreeHelper.GetParent(this);

            parent = visualParent as PlotBase;
            while (visualParent != null && parent == null)
            {
                visualParent = VisualTreeHelper.GetParent(visualParent);
                parent       = visualParent as PlotBase;
            }
            if (parent != null)
            {
                parent.MouseMove  += new MouseEventHandler(OnMouseMove);
                parent.MouseLeave += new MouseEventHandler(TooltipLayer_MouseLeave);
                subscription       = parent.CompositionChange.Subscribe(
                    next =>
                {
                    RefreshTooltip();
                    heatmapSubscriptions.Clear();
                    foreach (UIElement elem in parent.RelatedPlots)
                    {
                        var heat = elem as HeatmapGraph;
                        if (heat != null)
                        {
                            heatmapSubscriptions.Add(heat, heat.RenderCompletion.Subscribe(
                                                         render =>
                            {
                                RefreshTooltip();
                            }));
                        }
                    }
                });
            }
        }
 private void LegendItemsPanelUnloaded(object sender, RoutedEventArgs e)
 {
     if (MasterPlot == null)
     {
         masterPlot = null;
     }
 }
 private void PlotAxisLoaded(object sender, RoutedEventArgs e)
 {
     masterPlot = PlotBase.FindMaster(this);
     if (masterPlot != null)
     {
         InvalidateAxis();
     }
 }
Ejemplo n.º 5
0
 private void RemoveDependant(PlotBase dependant)
 {
     if (dependantsField.Contains(dependant))
     {
         dependantsField.Remove(dependant);
         EnumAll(plot => plot.NotifyCompositionChange());
     }
 }
Ejemplo n.º 6
0
 private void DisconnectMaster()
 {
     if (masterField != this)
     {
         masterField.RemoveDependant(this);
         InvalidateBounds();
         masterField = this;
     }
 }
        private void OnMasterPlotChanged(DependencyPropertyChangedEventArgs e)
        {
            PlotBase newPlot = (PlotBase)e.NewValue;

            if (newPlot != null)
            {
                masterPlot = newPlot;
            }

            Resubscribe();
        }
        private void LegendItemsPanelLoaded(object sender, RoutedEventArgs e)
        {
            if (MasterPlot == null)
            {
                masterPlot = PlotBase.FindMaster(this);
            }
            else
            {
                masterPlot = MasterPlot;
            }

            Resubscribe();
        }
Ejemplo n.º 9
0
        void MouseNavigationUnloaded(object sender, RoutedEventArgs e)
        {
            if (masterPlot != null)
            {
                masterPlot.MouseLeave          -= MouseNavigationLayer_MouseLeave;
                masterPlot.MouseMove           -= MouseNavigationLayer_MouseMove;
                masterPlot.MouseLeftButtonUp   -= MouseNavigationLayer_MouseLeftButtonUp;
                masterPlot.MouseLeftButtonDown -= MouseNavigationLayer_MouseLeftButtonDown;
                masterPlot.MouseWheel          -= MouseNavigationLayer_MouseWheel;
            }

            masterPlot    = null;
            parentControl = null;
        }
Ejemplo n.º 10
0
        void HeatmapTooltipLayer_Loaded(object sender, RoutedEventArgs e)
        {
            var visualParent = VisualTreeHelper.GetParent(this);

            parent = visualParent as PlotBase;
            while (visualParent != null && parent == null)
            {
                visualParent = VisualTreeHelper.GetParent(visualParent);
                parent       = visualParent as PlotBase;
            }
            if (parent != null)
            {
                parent.MouseMove  += new MouseEventHandler(OnMouseMove);
                parent.MouseLeave += new MouseEventHandler(TooltipLayer_MouseLeave);
            }
        }
Ejemplo n.º 11
0
        static void DataCoordinatePropertyChangedHandler(DependencyObject obj, DependencyPropertyChangedEventArgs args)
        {
            PlotBase plotBase = null;

            if (obj is PlotBase)
            {
                plotBase = obj as PlotBase;
            }
            else
            {
                var parent = VisualTreeHelper.GetParent(obj);
                if (parent is ContentPresenter)
                {
                    parent = VisualTreeHelper.GetParent(parent);
                }
                plotBase = parent as PlotBase;
            }
            if (plotBase != null)
            {
                plotBase.InvalidateBounds();
            }
        }
Ejemplo n.º 12
0
        void MouseNavigationLoaded(object sender, RoutedEventArgs e)
        {
            masterPlot = PlotBase.FindMaster(this);

            if (masterPlot != null)
            {
                masterPlot.MouseLeave          += MouseNavigationLayer_MouseLeave;
                masterPlot.MouseMove           += MouseNavigationLayer_MouseMove;
                masterPlot.MouseLeftButtonUp   += MouseNavigationLayer_MouseLeftButtonUp;
                masterPlot.MouseLeftButtonDown += MouseNavigationLayer_MouseLeftButtonDown;
                masterPlot.MouseWheel          += MouseNavigationLayer_MouseWheel;
            }

            var parent        = VisualTreeHelper.GetParent(this);
            var controlParent = parent as Control;

            while (parent != null && controlParent == null)
            {
                parent        = VisualTreeHelper.GetParent(parent);
                controlParent = parent as Control;
            }
            parentControl = controlParent;
        }
 private void PlotAxisUnloaded(object sender, RoutedEventArgs e)
 {
     masterPlot = null;
 }
 void KeyboardNavigationLoaded(object sender, RoutedEventArgs e)
 {
     masterPlot = PlotBase.FindMaster(this);
 }
 void KeyboardNavigationUnloaded(object sender, RoutedEventArgs e)
 {
     masterPlot = null;
 }