Added ability for viewmodel to take custom view, originally from 8745aacad5195b83e01172187a706eaa788fa65b