Exemplo n.º 1
0
        public static IViewResolverAssociateAware Associate <TViewModel>(this IViewResolverAssociateAware service,
                                                                         ResourceDescriptor container = null,
                                                                         ResourceDescriptor style     = null,
                                                                         IDataTemplate template       = null)
        {
            if (service == null)
            {
                throw new ArgumentNullException(nameof(service));
            }

            if (container != null)
            {
                service.AssociateContainer <TViewModel>(container);
            }
            if (style != null)
            {
                service.AssociateStyle <TViewModel>(style);
            }
            if (template != null)
            {
                service.AssociateTemplate <TViewModel>(template);
            }

            return(service);
        }
Exemplo n.º 2
0
 public static IViewAssociationBuilder AssociateTemplate <TViewModel>(this IViewResolverAssociateAware service, ResourceDescriptor descriptor)
 {
     if (service == null)
     {
         throw new ArgumentNullException(nameof(service));
     }
     return(service.Associate(typeof(TemplateResolver), typeof(TViewModel), descriptor));
 }
Exemplo n.º 3
0
 public static IViewAssociationBuilder AssociateStyle <TViewModel>(this IViewResolverAssociateAware service, Style style)
 {
     if (service == null)
     {
         throw new ArgumentNullException(nameof(service));
     }
     return(service.Associate(typeof(StyleResolver), typeof(TViewModel), style));
 }
Exemplo n.º 4
0
 public static IViewAssociationBuilder AssociateContainer <TViewModel>(this IViewResolverAssociateAware service, ItemContainerTemplate template)
 {
     if (service == null)
     {
         throw new ArgumentNullException(nameof(service));
     }
     return(service.Associate(typeof(ContainerResolver), typeof(TViewModel), template));
 }