In Xamarin.Android Bindings, I have an interface wrapped from Java as follows:
// Metadata.xml XPath interface reference: path="/api/package[@name='com.buyandlarge.core.framework']/interface[@name='IView']"
[Register ("com/buyandlarge/core/framework/IView", "", "BuyAndLarge.Core.Framework.IViewInvoker")]
public partial interface IView : global::Core.Framework.IContextProvider, global::BuyAndLarge.Core.Framework.IHitTestable {
global::Android.Views.ViewGroup.LayoutParams LayoutParams {
// Metadata.xml XPath method reference: path="/api/package[@name='com.buyandlarge.core.framework']/interface[@name='IView']/method[@name='getLayoutParams' and count(parameter)=0]"
[Register ("getLayoutParams", "()Landroid/view/ViewGroup$LayoutParams;", "GetGetLayoutParamsHandler:BuyAndLarge.Core.Framework.IViewInvoker, BuyAndLarge.Core")] get;
// Metadata.xml XPath method reference: path="/api/package[@name='com.buyandlarge.core.framework']/interface[@name='IView']/method[@name='setLayoutParams' and count(parameter)=1 and parameter[1][@type='android.view.ViewGroup.LayoutParams']]"
[Register ("setLayoutParams", "(Landroid/view/ViewGroup$LayoutParams;)V", "GetSetLayoutParams_Landroid_view_ViewGroup_LayoutParams_Handler:BuyAndLarge.Core.Framework.IViewInvoker, BuyAndLarge.Core")] set;
}
}
Various classes which inherit global::Android.Views.View
implement this interface. For some bizarre reason, Xamarin's implementation of Android.Views.View has the property defined as public virtual ViewGroup.LayoutParams LayoutParameters { get; set; }
so I get hundreds of 'The type Foo does not implement IView.LayoutParams' errors in my code.
I'd like to use metadata.xml to rename IView.LayoutParams to IView.LayoutParameters, but not sure of the syntax.
I have tried this:
<attr path="/api/package[@name='com.buyandlarge.core.framework']/interface[@name='IView']/method[@name='getLayoutParams' and count(parameter)=0]" name="managedName">LayoutParameters</attr>
<attr path="/api/package[@name='com.buyandlarge.core.framework']/interface[@name='IView']/method[@name='setLayoutParams' and count(parameter)=1 and parameter[1][@type='android.view.ViewGroup.LayoutParams']]" name="managedName">LayoutParameters</attr>
but no success ... Any ideas?