C
C#2y ago
khamas

✅ bind prop or field to Entry in MAUI

Hey how do I directly bind a prop or field to an Entry or Label in MAUI? The docs aren’t clear
11 Replies
333fred
333fred2y ago
Basic bindings - .NET MAUI
.NET MAUI data binding links a pair of properties between two objects, at least one of which is usually a user-interface object. These two objects are called the target and the source.
333fred
333fred2y ago
The docs go over that in detail
khamas
khamasOP2y ago
I can't find an example of where it binds to a field, only binds to another component/control value maybe I'm blind
chilldog
chilldog2y ago
If you read through the article it is talking about a few different solutions to your question I think. I would go through and try out the demo.
333fred
333fred2y ago
Your problem is that you are thinking there's a difference There isn't
khamas
khamasOP2y ago
so if you know how to can you share a snippet of an control having it's value bound to a field?
333fred
333fred2y ago
It's literally exactly the same as any other binding But no, I'm on my phone right now You set the binding context, and bind to the field you want
khamas
khamasOP2y ago
so how do I have this as a binding context? it's not shown @Orannis
333fred
333fred2y ago
That's the default The reason why the very first example works is because that's the default If you ever need to explicitly say this, you use . as the path
khamas
khamasOP2y ago
oh thanks a lot
Accord
Accord2y ago
Closed!
Want results from more Discord servers?
Add your server