MvvmCross.Core.ViewModels.MvxViewModelViewTypeFinder.LookupAttributedViewModelType C# (CSharp) Method

LookupAttributedViewModelType() protected method

protected LookupAttributedViewModelType ( Type candidateType ) : Type
candidateType System.Type
return System.Type
        protected virtual Type LookupAttributedViewModelType(Type candidateType)
        {
            var attribute = candidateType
                                .GetCustomAttributes(typeof(MvxViewForAttribute), false)
                                .FirstOrDefault() as MvxViewForAttribute;

            return attribute?.ViewModel;
        }