// Notes: // - Links the camera of two scenes without adding GC references // - View3dControls do not use these directly, they are a helper for higher level code. public ViewLink(View3dControl source, View3dControl target, ELinkCameras cam = ELinkCameras.None) { Source = new WeakReference <View3dControl>(source); Target = new WeakReference <View3dControl>(target); CamLink = cam; // Watch for navigation events on 'source' and apply them to 'target' source.Window.MouseNavigating += WeakRef.MakeWeak <View3d.MouseNavigateEventArgs>(OnSourceNavigation, h => source.Window.MouseNavigating -= h); }
// Notes: // - Links the camera or axis range of two charts without adding a GC references. // - ChartControls do not use these directly, they are a helper for higher level code. public ChartLink(ChartControl source, ChartControl target, ELinkCameras cam = ELinkCameras.None, ELinkAxes axis = ELinkAxes.None) : base(source.Scene, target.Scene, cam) { Source = new WeakReference <ChartControl>(source); Target = new WeakReference <ChartControl>(target); AxisLink = axis; // Watch for axis range changes source.ChartMoved += WeakRef.MakeWeak <ChartControl.ChartMovedEventArgs>(OnSourceChartMoved, h => source.ChartMoved -= h); }