You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+78Lines changed: 78 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -350,6 +350,16 @@ public class MyViewModel : IBindingContext
350
350
351
351
> **Note:** You need to define `IntToStrConverter` to convert int to string. See the [PropertyValueConverter](#propertyvalueconvertertsourcetype-ttargettype) section for more information.
352
352
353
+
You can use the `Observable` attribute even on `public` properties to override the binding path.
A common scenario, for instance, when working with collection items, is to create a wrapping "bindable" item model that relays properties of the collection item model, and raises the property value changed notifications when needed.
To provide the `CustomViewModel` as a binding context for certain elements, we have to create a `BindingContextProvider` and use it as the parent for those elements.
In this example, `Label1` and `Label2` will display the text "Main Context", while `Label3` will display the text "Custom Context".
1100
+
1023
1101
### Source code generator
1024
1102
1025
1103
The best way to speed up the creation of custom `VisualElement` is to use source code generators. With this powerful tool, you can achieve the same great results with minimal boilerplate code and focus on what really matters: programming!
0 commit comments