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(); } } }
private void LegendItemsPanelUnloaded(object sender, RoutedEventArgs e) { if (MasterPlot == null) { masterPlot = null; } }
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 PlotAxisLoaded(object sender, RoutedEventArgs e) { masterPlot = PlotBase.FindMaster(this); if (masterPlot != null) { InvalidateAxis(); } }
private void RemoveDependant(PlotBase dependant) { if (dependantsField.Contains(dependant)) { dependantsField.Remove(dependant); EnumAll(plot => plot.NotifyCompositionChange()); } }
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(); }
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; }
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; }