New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Native Bindings #278
Native Bindings #278
Conversation
TargetReference = new WeakReference<TNativeView>(target); | ||
} | ||
|
||
public void TransferAttachedPropertiesTo(View wrapper) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Palette
need to update docs |
b6c9dfa
to
6de2bd7
Compare
@jassmith done please review |
f4092c4
to
c1c60a9
Compare
rebased as of today |
214e13e
to
36e2470
Compare
namespace Xamarin.Forms.ControlGallery.Android | ||
{ | ||
public class ColorPickerView : ViewGroup | ||
//, INotifyPropertyChanged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is removing INotifyPropertyChanged intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, just for testing
865a400
to
08f1289
Compare
08f1289
to
8b85e28
Compare
|
||
namespace Xamarin.Forms | ||
{ | ||
static class NativeBindingHelpers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the meaty part to review. It's actually the only important part to review as well.
* [C, I, A, W] Support Native Bindings * fix tabs
* iOS secure storage simulator tests (#247) * Remove line that skips test on virtual devices * Adding keychain-access-groups in Entitlements.plist * Setting CodeSign entitlements for Debug configuration * Making same entitlement.plist changes for iOS sample * Removing specific code sign key * Removing physical device trait for iOS SecureStorageTests * Update DeviceTests.iOS.csproj * Update Samples.iOS.csproj * Add configs for codesign on release
* GH-221: Add iOS SecAccessible properties (#223) * Address #221, use AfterFirstUnlockThisDeviceOnly to match other platforms. Although allow a platform specific override to set accessible state. * Add tests * Added iOS specific prop to set SecAccessible * Default to AfterFirstUnlock on iOS SecureStorage * A few fixes for the release. (#228) * Setting the correct flags for Chrome Tabs. Fixes #225 * Make sure that there is data to decrypt before starting. Fixes #226 * Fixes for TTS. Fixes #227 * A bit of the fixes for emails on iOS. Relates to #224 * Update the email bit for iOS #224 * Cleaning up the code #224 * Make sure to set the email properties. Fixes #229 * Update SDK Extras This fixes a lot of references that were required on android that aren't. * Update Readme with Installation information. (#237) * Update Readme with Installation information. * Update README.md * Update README.md * Adding the initial work to get Tizen started. #23 * Revert "Adding the initial work to get Tizen started. #23" This reverts commit 58b6041. * Update the docs with the latest APIs (#233) Add docs for SecAccessible * GH-245: Add Orientation Sensor (#249) * Add Orientation Sensor * Add Orientation Sensor * Remove .csproj clutter * "orientationsensor" --> "orientation sensor" or just "orientation" * GH-192: Added DateTime to Preferences (#232) * Added DateTime to preferences. Fixes #192 - also properly using overloads * Added some unit tests * Added the docs for the new Preferences APIs * Update Readme with Device Display Information Added link to Current Features for Device Display Information * Fixes #258 and Fixes #255 (#259) * Fixes #258 * put vectors nuget everywhere. * NuGet is broken - https://developercommunity.visualstudio.com/content/problem/232996/warning-nu1603-runtimenativesystemiocompression-41.html * The NuGet doesn't add the assembly references from the GAC * We need to use a later version of the iOS SDK * Fix typo (#274) * Fix up null checks when getting lask known location. * Additional Null checks * GH-240 Add IsMainThread detection API (#277) * Add IsMainThread detection API * Add platform tests for main thread * Update docs and add more platform tests * iOS secure storage simulator tests (#247) (#278) * iOS secure storage simulator tests (#247) * Remove line that skips test on virtual devices * Adding keychain-access-groups in Entitlements.plist * Setting CodeSign entitlements for Debug configuration * Making same entitlement.plist changes for iOS sample * Removing specific code sign key * Removing physical device trait for iOS SecureStorageTests * Update DeviceTests.iOS.csproj * Update Samples.iOS.csproj * Add configs for codesign on release * Fixes #181 Allowing setting of calibration for heading. (#282) * GH-254 Update Support Packages, Forms, and Reference Vectors (#279) * Update Support Packages, Forms, and Reference Vectors * Bump targetsdk * Fix android build :) * Fix build
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,
SetBinding
can take an additionalupdateSourceEventName
argument. On iOS, if the Property of theUIView
is Observable, theupdateSourceEventName
is 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
SetBindingContext
is 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