private void ApplyAttributes(Context c, IAttributeSet attrs) { _headerId = DEFAULT_HEADER_ID; _footerId = DEFAULT_HEADER_ID; using (var attributes = c.ObtainDisposableStyledAttributes(attrs, Resource.Styleable.ListView)) { foreach (var a in attributes) { switch (a) { case Resource.Styleable.ListView_header: _headerId = attributes.GetResourceId(a, DEFAULT_HEADER_ID); break; case Resource.Styleable.ListView_footer: _footerId = attributes.GetResourceId(a, DEFAULT_HEADER_ID); break; } } } }