prop = ApplyPropertiesVisitor.GetContentPropertyName(t.GetTypeInfo());
if (prop == null)
return;
- setter = t.GetRuntimeProperty(prop).SetMethod;
+ setter = t.GetRuntimeProperty(prop)?.SetMethod;
}
else
- setter = markupExtension.GetType().GetRuntimeProperty(prop).SetMethod;
+ setter = markupExtension.GetType().GetRuntimeProperty(prop)?.SetMethod;
if (value == null && strValue != null)
{
- value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop).PropertyType,
+ value = strValue.ConvertTo(markupExtension.GetType().GetRuntimeProperty(prop)?.PropertyType,
(Func<TypeConverter>)null, serviceProvider);
}
var bindable = weakbindable.Target as BindableObject;
if (bindable == null)
continue;
- item.DetachFrom(bindable);
+ item?.DetachFrom(bindable);
}
}
base.ClearItems();
var bindable = weakbindable.Target as BindableObject;
if (bindable == null)
continue;
- item.AttachTo(bindable);
+ item?.AttachTo(bindable);
}
}
_associatedObjects.Add(new WeakReference(bindable));
}
foreach (T item in this)
- item.AttachTo(bindable);
+ item?.AttachTo(bindable);
}
protected virtual void OnDetachingFrom(BindableObject bindable)
{
foreach (T item in this)
- item.DetachFrom(bindable);
+ item?.DetachFrom(bindable);
lock (_associatedObjects)
{
for (var i = 0; i < _associatedObjects.Count; i++)
var bindable = weakbindable.Target as BindableObject;
if (bindable == null)
continue;
- item.DetachFrom(bindable);
+ item?.DetachFrom(bindable);
}
base.RemoveItem(index);
var bindable = weakbindable.Target as BindableObject;
if (bindable == null)
continue;
- old.DetachFrom(bindable);
+ old?.DetachFrom(bindable);
}
base.SetItem(index, item);
var bindable = weakbindable.Target as BindableObject;
if (bindable == null)
continue;
- item.AttachTo(bindable);
+ item?.AttachTo(bindable);
}
}
}