void IStyle.UnApply(BindableObject bindable) { UnApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable)); bindable.RemoveDynamicResource(_basedOnResourceProperty); lock (_targets) { _targets.RemoveAll(wr => wr != null && wr.TryGetTarget(out BindableObject target) && target == bindable); } }
void IStyle.UnApply(BindableObject bindable) { UnApplyCore(bindable, BasedOn ?? GetBasedOnResource(bindable)); bindable.RemoveDynamicResource(_basedOnResourceProperty); _targets.RemoveAll(wr => { BindableObject target; return(wr.TryGetTarget(out target) && target == bindable); }); }