MaterialStyleEntryHandler : ViewHandler<Entry, TextInputLayout>: How to Map properties from newly created AppCompatEditText to the Virtual View? #25470
Replies: 2 comments
-
Same issue(s) here... So what I have done is to give your VirtualView a method/property that is not viewable from the development environment. Updating the VirtualView "TextInputLayout", add a EditorBrowsable attribute to the VirtualView method: and call it from your Handler/PlatformView.
|
Beta Was this translation helpful? Give feedback.
-
The biggest issue I've found so far is with Event tags. So for instance if I wanted to respond to a Focus event on the XMAL side, I cant figure out how to invoke a Focus event from the Platform control onto the VirtualView. to get around this I needed to create a bindable command property. I dont like having to do that. |
Beta Was this translation helpful? Give feedback.
-
I have a custom ViewHandler that I use to return a TextInputLayout which I can use to display controls in a Material design as we were using in Xamarin.
Here is my custom Handler. I Followed an example that @PureWeen created on his own Repo site, which was very helpful.
This works and the design look great, the issue is with Mapping FROM the nativeview, back to the Virtual View. Is there a Function I can call to set this mappings back? Or a way for me to write them all, or copy them form somewhere?
The issue is this. If I start typing in the Entry then the test updates, but the Binding Context to the View model does not update, so the data goes nowhere. I fix this by adding this event hook
and this works, as the VirtualView has all the binding context and by updating the text the binding context fires. I've seen other discussions here why the recommended answer was to use an EntryHandler, but that wont let me return a TextInputLayout.
Does anyone have any suggestions? I also have the same issue with a Custom Picker, which also has the TextInputLayout, and I'm still working on a workaround for that one.
Thanks
Joe
Beta Was this translation helpful? Give feedback.
All reactions