private void _attachLights() { bool hasRevealBorderLight = false; var element = Window.Current.Content; foreach (var item in element.Lights) { if (item is MyRevealBorderLight revealLight) { RevealBorderLight = revealLight; hasRevealBorderLight = true; break; } } if (!hasRevealBorderLight) { RevealBorderLight = new MyRevealBorderLight(); element.Lights.Add(RevealBorderLight); } MyRevealBorderLight.AddTargetBrush(MyRevealBorderLight.GetIdStatic(), this); }
private void _unAttachLights() { MyRevealBorderLight.RemoveTargetBrush(MyRevealBorderLight.GetIdStatic(), this); }