/// <summary> /// Deregister from image callbacks /// </summary> /// <param name="c">ImagerBase to unregister</param> public void UnregisterForImages(ImagerBase c) { if (c != null) { c.OnImageUpdated -= ImageUpdateHandler; ImagerWidth = 0; ImagerHeight = 0; HasImageSource = false; SubscribedImagers.Remove(c); c.Subscribers.Remove(this); } }
/// <summary> /// Register and unregister for image callbacks /// </summary> /// <param name="c">ImagerBase to register</param> public void RegisterForImages(ImagerBase c) { if (c != null) { c.OnImageUpdated -= ImageUpdateHandler; c.OnImageUpdated += ImageUpdateHandler; ImagerWidth = c.Width; ImagerHeight = c.Height; HasImageSource = true; SubscribedImagers.Add(c); c.Subscribers.Add(this); } }