Android.Dialog.ImageElement.GetViewImpl C# (CSharp) Method

GetViewImpl() protected method

protected GetViewImpl ( Android.Content.Context context, Android.Views.View convertView, Android.Views.ViewGroup parent ) : Android.Views.View
context Android.Content.Context
convertView Android.Views.View
parent Android.Views.ViewGroup
return Android.Views.View
        protected override View GetViewImpl(Context context, View convertView, ViewGroup parent)
        {
            if (scaled == null)
                scaled = Scale(Value);

            Click = delegate { SelectImage(); };

            var view = convertView as RelativeLayout ?? new RelativeLayout(context);

            var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
                                                        ViewGroup.LayoutParams.WrapContent);
            parms.SetMargins(5, 2, 5, 2);
            parms.AddRule(LayoutRules.AlignParentLeft);

            // SEC bug fix, not yet submitted to Kenny.  Getting exception "specified view already has a parent"
            if (scaled.Parent != view)
                view.AddView(scaled, parms);

            return view;
        }