Here is a sample model to consider:
public class ProfileViewModel
{
public string LanguageCode { get; set; }
public ProfileLocalizationViewModel CurrentLocalization { get; set; }
public List<ProfileLocalizationViewModel> Localizations { get; set; }
}
I am trying to automatically retrieve the CurrentLocalization
from the Localizations
based on the LanguageCode
. I am aware of the ko.computed()
function, but since I will be passing a list of ProfileViewModel
to the client, manually setting the CurrentLocalization
as a computed property in knockout doesn't seem feasible. Is it possible to achieve this desired functionality? If not, what alternative approaches could I take to accomplish something similar? Any assistance would be greatly valued.