Android.Dialog.EntryElementHelper.EnsureTagged C# (CSharp) Method

EnsureTagged() public static method

public static EnsureTagged ( EditText editText ) : EntryElementHelper
editText EditText
return EntryElementHelper
        public static EntryElementHelper EnsureTagged(EditText editText)
        {
            var tag = (EntryElementHelper)editText.Tag;
            if (tag == null)
            {
                tag = new EntryElementHelper(editText);
                editText.Tag = tag;
            }
            return tag;
        }

Usage Example

Example #1
0
        protected override View GetViewImpl(Context context, View convertView, ViewGroup parent)
        {
            var view = DroidResources.LoadStringEntryLayout(context, convertView, parent, LayoutName);

            if (view != null)
            {
                view.FocusableInTouchMode = false;
                view.Focusable            = false;
                view.Clickable            = false;

                TextView label;
                EditText _entry;
                DroidResources.DecodeStringEntryLayout(context, view, out label, out _entry);

                _entry.FocusableInTouchMode = true;
                _entry.Focusable            = true;
                _entry.Clickable            = true;

                var helper = EntryElementHelper.EnsureTagged(_entry);
                helper.Owner = this;
            }

            return(view);
        }