Unable to Bind Button Onclick to FOnButtonClickedEvent using UMG ViewModel MVVM plugin.

I am using UMG view model plugin for MVVM design pattern. I am trying to Bind button onlcick from BP to FOnButtonClickedEvent in C++

Here is my ViewModel File

#pragma once
#include "CoreMinimal.h"
#include "MVVMViewModelBase.h"
#include "Components/Button.h"
#include "MyMVVMViewModelBase.generated.h"
UCLASS()
class MVVMTESTER_API UMyMVVMViewModelBase : public UMVVMViewModelBase
{
	GENERATED_BODY()
public:
	UPROPERTY(BlueprintReadWrite,FieldNotify)
	FOnButtonClickedEvent AnyCLickableButton;
};

Here is my BP

Here is the error I am getting:

Kindly point out the issue.

3 Likes

i have the same issue, did u find a solution?

It’s not bound to buttons (they are greyed out in BP). You could bind it to a bool parameter and switch that bool = ! bool value to trigger the vm.

good decision, thanks!