Esempio 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();
                }
            }
        }
Esempio n. 2
0
 private void LegendItemsPanelUnloaded(object sender, RoutedEventArgs e)
 {
     if (MasterPlot == null)
     {
         masterPlot = null;
     }
 }
Esempio n. 3
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();
                            }));
                        }
                    }
                });
            }
        }
Esempio n. 4
0
 private void PlotAxisLoaded(object sender, RoutedEventArgs e)
 {
     masterPlot = PlotBase.FindMaster(this);
     if (masterPlot != null)
     {
         InvalidateAxis();
     }
 }
Esempio n. 5
0
 private void RemoveDependant(PlotBase dependant)
 {
     if (dependantsField.Contains(dependant))
     {
         dependantsField.Remove(dependant);
         EnumAll(plot => plot.NotifyCompositionChange());
     }
 }
Esempio n. 6
0
 private void disconnectMaster()
 {
     if (masterField != this)
     {
         masterField.RemoveDependant(this);
         InvalidateBounds();
         masterField = this;
     }
 }
Esempio n. 7
0
        private void OnMasterPlotChanged(DependencyPropertyChangedEventArgs e)
        {
            PlotBase newPlot = (PlotBase)e.NewValue;

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

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

            Resubscribe();
        }
Esempio 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;
        }
Esempio n. 10
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;
        }
Esempio n. 11
0
 private void PlotAxisUnloaded(object sender, RoutedEventArgs e)
 {
     masterPlot = null;
 }
Esempio n. 12
0
 void KeyboardNavigationLoaded(object sender, RoutedEventArgs e)
 {
     masterPlot = PlotBase.FindMaster(this);
 }
Esempio n. 13
0
 void KeyboardNavigationUnloaded(object sender, RoutedEventArgs e)
 {
     masterPlot = null;
 }