banditoth / MAUI.Packages

A toolkit for .NET MAUI 🏝, containing useful stuff to ease development for MAUI applications.
MIT License
39 stars 3 forks source link

[Multilanguage] How to bind dynamic value to "Key"? #9

Open Edvard-D opened 1 year ago

Edvard-D commented 1 year ago

I have a bit of text that I'd like to change depending on the model data that is assigned to the page. In this case, the model is StoryGroupModel and the string property on it with the key is TitleTextKey. I tried doing this with the code below, but got the exception: "No property, BindableProperty, or event found for "Key", or mismatching type between value and property."

TitleText="{multilanguage:Translation Key={Binding StoryGroupModel.TitleTextKey}}"

Is there some way to achieve this?