private void AddViewport(ShadowVisual viewport, Vector globalOffset) { ViewportViewModel model = new ViewportViewModel(viewport, globalOffset, Scale); _viewports[viewport] = model; Viewports.Add(model); }
/// <summary> /// recusively add all descendants for tracking /// </summary> /// <param name="monitor"></param> /// <param name="visual"></param> protected void Instrument(Monitor monitor, HeliosVisual visual) { foreach (HeliosVisual child in visual.Children) { Children[child] = new ShadowVisual(_parent, monitor, child); } }
public void RemoveViewport(ShadowVisual shadowViewport) { shadowViewport.ViewportChanged -= Raw_ViewportChanged; _viewports.Remove(shadowViewport.Visual); ViewportRemoved?.Invoke(this, new ShadowViewportEventArgs(shadowViewport)); // update viewport count on hosting monitor ShadowMonitor monitor = _monitors[shadowViewport.Monitor]; monitor.RemoveViewport(); // recalculate, delayed ScheduleGeometryChange(); }
public void AddViewport(ShadowVisual shadowViewport) { _viewports[shadowViewport.Visual] = shadowViewport; ViewportAdded?.Invoke(this, new ShadowViewportEventArgs(shadowViewport)); // update viewport count on hosting monitor ShadowMonitor monitor = _monitors[shadowViewport.Monitor]; monitor.AddViewport(); shadowViewport.ViewportChanged += Raw_ViewportChanged; // recalculate, delayed ScheduleGeometryChange(); }
protected virtual void OnRemoved(HeliosVisual oldChild) { if (!Children.ContainsKey(oldChild)) { // this has happened before and it is unclear why ConfigManager.LogManager.LogInfo( $"the Visual object {oldChild.Name} of type {oldChild.TypeIdentifier} was not found in the data used for tracking viewports and monitors; probable program error"); return; } ShadowVisual shadow = Children[oldChild]; shadow.Dispose(); Children.Remove(oldChild); }
public ShadowViewportEventArgs(ShadowVisual shadow) { Data = shadow; }
protected virtual void OnAdded(HeliosVisual newChild) { Children[newChild] = new ShadowVisual(_parent, Monitor, newChild); }