Use Resource instead of raw types in UIContextFactory