void OnFacesDetected(object sender, FacesEventArgs e) { foreach (var face in e.Faces) { noveltyLayers.Add(face, new NoveltyAttachment()); face.PropertyChanged += Face_PropertyChanged; } }
void OnFacesRemoved(object sender, FacesEventArgs e) { foreach (var face in e.Faces) { face.PropertyChanged -= Face_PropertyChanged; var att = noveltyLayers [face]; if (att.Layer != null) { att.Layer.RemoveFromSuperLayer(); } noveltyLayers.Remove(face); } }