public void Detach() { if (Attached) { Redirects.CollectionChanged += RedirectsCahnged; AttachedItems = Redirects.ToArray(); foreach (var redirect in AttachedItems) { redirect.PropertyChanged += RedirectCahnged; } AttachedItems = null; Attached = false; } }
public void Attach() { if (!Attached) { Attached = true; Redirects.CollectionChanged += RedirectsCahnged; AttachedItems = Redirects.ToArray(); foreach (var redirect in AttachedItems) { redirect.PropertyChanged += RedirectCahnged; } IsDirty = false; } }