Proper way to bind this delegate? AddDynamic isn't working

Hi again,

Bit of a noob situation but I’m having trouble binding a delegate.


template <typename ItemType>
class ITypedUMGListView
	using NullableItemType = typename SListView<ItemType>::NullableItemType;

	// Automatically implemented via IMPLEMENT_TYPED_UMG_LIST()
	DECLARE_MULTICAST_DELEGATE_OneParam(FSimpleListItemEvent, ItemType);
	virtual FSimpleListItemEvent& OnItemClicked() const = 0;

I usually use AddDynamic but it fails.

Thanks for any help.

You could use AddRaw for non-UObject-classes or you would have to use a delegate-variable for UObject-classes, which would be:

FOnXYZDelegate MyDelegateMember = FOnXYZDelegate::CreateUObject(this, &MyClass::MyDelegateFunc)

If you search for DECLARE_MULTICAST_DELEGATE_OneParam in the unreal sources, you can find a lot of other examples.