Created
March 18, 2014 18:26
-
-
Save brendanzagaeski/9626279 to your computer and use it in GitHub Desktop.
Work around for Xamarin.Android binding of methods in the Socialize SDK's `ITwitterAuthWebView` that are inherited as properties from `WebView`
This file contains 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
using System; | |
using Android.Views; | |
using Android.Webkit; | |
namespace Com.Socialize.Auth.Twitter | |
{ | |
/// <summary> | |
/// Use "wrapper" methods to work around these two binding errors: | |
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetLayoutParams(Android.Views.ViewGroup.LayoutParams)' (CS0535) | |
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetVisibility(int)' (CS0535) | |
/// </summary> | |
/// <remarks> | |
/// Although _in theory_ you could work around the errors by changing the | |
/// setter methods in `ITwitterAuthWebView` to `set` methods of properties, | |
/// this would be against recommended property design practice: | |
/// "DO NOT provide set-only properties" | |
/// (http://msdn.microsoft.com/en-us/library/ms229006.aspx) | |
/// </remarks> | |
public partial class TwitterAuthWebView | |
{ | |
public void SetLayoutParams(ViewGroup.LayoutParams parameters) | |
{ | |
LayoutParameters = parameters; | |
} | |
public void SetVisibility(int visibility) | |
{ | |
Visibility = (ViewStates)visibility; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment