I’m trying to give a default value to the register property method. This required a function, but passed as an object(delegate?). Here’s the code:
protected static propertydata registerproperty(string name, Type type, Func<object> createDefaultValue)
{
return RegisterProperty(name, type, createDefaultValue, false, null);
}
I want to call that registerproperty method, but I don’t know how I can do that in VB.net. I just need to pass along a new Person object and I thought this was the way to go:
Public Shared ReadOnly ItemsProperty As PropertyData = RegisterProperty("Items", GetType(IEnumerable(Of Person)), Function() new Person())
This is a function passed as a function, but I need it to pass as an object.
Any thoughts on this?
Sometimes, working with a sub instead of a function resolves the issue, we’ve solved some problems that way.