This repository was archived by the owner on May 1, 2024. It is now read-only.
Merged
Conversation
| TargetReference = new WeakReference<TNativeView>(target); | ||
| } | ||
|
|
||
| public void TransferAttachedPropertiesTo(View wrapper) |
Member
Author
There was a problem hiding this comment.
This needs to be replaced by a static call on the helper
When that's done, the BindableProxy should be deeply hidden as a nested class
FIXED
436535a to
b6c9dfa
Compare
| Droid.Graphics.Point currentPoint; | ||
| ColorPointer colorPointer; | ||
| ImageView imageViewSelectedColor; | ||
| ImageView imageViewPallete; |
Contributor
|
need to update docs |
b6c9dfa to
6de2bd7
Compare
Member
|
@jassmith done please review |
f4092c4 to
c1c60a9
Compare
Member
Author
|
rebased as of today |
214e13e to
36e2470
Compare
| namespace Xamarin.Forms.ControlGallery.Android | ||
| { | ||
| public class ColorPickerView : ViewGroup | ||
| //, INotifyPropertyChanged |
Contributor
There was a problem hiding this comment.
Is removing INotifyPropertyChanged intended?
865a400 to
08f1289
Compare
08f1289 to
8b85e28
Compare
|
|
||
| namespace Xamarin.Forms | ||
| { | ||
| static class NativeBindingHelpers |
Member
Author
There was a problem hiding this comment.
This is the meaty part to review. It's actually the only important part to review as well.
rmarinho
pushed a commit
that referenced
this pull request
Sep 13, 2016
* [C, I, A, W] Support Native Bindings * fix tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
Allow binding to Native (non-BP) Views.
Each platform now expose
SetBinding(string propertyName, BindingBase binding)as an extension method on the respective native views (UIView,Android.View,FrameworkElement).To get 2-Way Bindings to work,
SetBindingcan take an additionalupdateSourceEventNameargument. On iOS, if the Property of theUIViewis Observable, theupdateSourceEventNameis not mandatory. On [U]WP, something similar is done in order to try to get 2-Way bindings to behave even without the updateSourceEventName.In addition to this, the platforms also expose
SetValue(BindableProperty property, ...)andSetBinding(BindableProperty property, ...). Those will have no effect unless the view happen to be directly wrapped in a Xamarin.Forms Layout. In that case, those (attached) BindableProperties will be transferred to the wrapper, allowing this kind of code to be valid.The
SetBindingContextis not meant to be invoked directly, but it's used by the platform.The value of this will make more sense when the Xaml support is added.
Bugs Fixed
None
API Changes
Added:
iOS:
public static void SetBinding(this UIView view, string propertyName, BindingBase binding, string updateSourceEventName = null);public static void SetBinding(this UIView self, BindableProperty targetProperty, BindingBase binding);public static void SetValue(this UIView target, BindableProperty targetProperty, object value);public static void SetBindingContext(this UIView target, object bindingContext, Func<UIView, IEnumerable<UIView>> getChildren = null);Android
public static void SetBinding(this global::Android.Views.View view, string propertyName, BindingBase binding, string updateSourceEventName = null);public static void SetBinding(this global::Android.Views.View view, BindableProperty targetProperty, BindingBase binding);public static void SetValue(this global::Android.Views.View target, BindableProperty targetProperty, object value);public static void SetBindingContext(this global::Android.Views.View target, object bindingContext, Func<global::Android.Views.View, IEnumerable<global::Android.Views.View>> getChildren = null);[U]WP
public static void SetBinding(this FrameworkElement view, string propertyName, BindingBase binding, string updateSourceEventName = null);public static void SetBinding(this FrameworkElement view, BindableProperty targetProperty, BindingBase binding);public static void SetValue(this FrameworkElement target, BindableProperty targetProperty, object value);public static void SetBindingContext(this FrameworkElement target, object bindingContext, Func<FrameworkElement, IEnumerable<FrameworkElement>> getChildren = null);PR Checklist