Hello, I’m experimenting with the Beta of the UMG ViewModel package, and I need to bind a Combobox’s options to a list to names I’ve extracted from a list of DataAssets. The end result should look like this:
To do so, I created a ScenarioViewModel that I then attached to the ViewModelGameSystem to allow the UI to access it, like so:
Then, in the VM, I created a variable for the list of Scenarios with Field Notify set to True, so that when it changes, the function GetScenarioOptions is triggered and creates a list of options from all scenarios’ names:
The issue comes when I try to bind that function to the Combobox. I’ve tried to bind it to the Default Options, but apparently those are only writeable at initialization, not runtime. Trying to compile this results in an error
Binding ‘ScenarioComboBox.DefaultOptions ← MV_Scenario.ScenarioOptions’: Couldn’t create the destination field path ‘ScenarioComboBox.DefaultOptions’. Property ‘Default Options’ is not writable at runtime.
The dropdown in the View Bindings window doesn’t offer another variable to bind the array of strings to. So how do I do this within the context of the MVVM pattern? Is it not yet supported, or am I doing this the wrong way?
Thank you for your answers!