Files
UnrealEngineUWP/Engine/Plugins/Runtime/ModelViewViewModel/Source/ModelViewViewModelBlueprint/Private/MVVMBlueprintViewModelContext.cpp
patrick boutot 7a499cf935 MVVM: Use the viewmodel name instead of the class name. Create the menu to add a viewmodel. Use a UClass of any class at implement the NotifyFieldValue interface in BlueprintViewModelContext instead a ViewModelBase class.
#rb sebastien.nordgren
#preflight 62bc45213771c5710de91653

#ROBOMERGE-AUTHOR: patrick.boutot
#ROBOMERGE-SOURCE: CL 20874026 via CL 20881496 via CL 20881723
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v971-20777995)

[CL 20885743 by patrick boutot in ue5-main branch]
2022-06-29 19:00:59 -04:00

22 lines
592 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MVVMBlueprintViewModelContext.h"
#include "FieldNotification/IFieldValueChanged.h"
FMVVMBlueprintViewModelContext::FMVVMBlueprintViewModelContext(const UClass* InClass, FName InViewModelName)
{
if (InClass && InClass->ImplementsInterface(UNotifyFieldValueChanged::StaticClass()))
{
ViewModelContextId = FGuid::NewGuid();
NotifyFieldValueClass = const_cast<UClass*>(InClass);
ViewModelName = InViewModelName;
}
}
FText FMVVMBlueprintViewModelContext::GetDisplayName() const
{
return FText::FromName(ViewModelName);
}