Example #1
0
            public void Bind(TemplateContract templateContract, GetTemplateChild templateChildProvider)
            {
                foreach (var partDescription in _partDescriptions)
                {
                    var templatePart = templateChildProvider(partDescription.Name);
                    if (templatePart == null)
                    {
                        if (partDescription.Required)
                        {
                            throw new TemplateValidationException(partDescription.Name);
                        }

                        continue;
                    }

                    if (partDescription.PartType.IsInstanceOfType(templatePart))
                    {
                        partDescription.Setter(templateContract, templatePart);
                    }
                }
            }
Example #2
0
 public TemplateContractBinder(FrameworkElement frameworkElement)
 {
     _templateChildProvider = new TemplateDiscovery(frameworkElement).GetChild;
 }
Example #3
0
 public TemplateContractBinder(GetTemplateChild templateChildProvider)
 {
     _templateChildProvider = templateChildProvider;
 }
Example #4
0
 public UpDownBaseTemplateContract(GetTemplateChild templateDiscovery, Action onAttach, Action onDetach) : base(templateDiscovery, onAttach, onDetach)
 {
 }
Example #5
0
 public TemplateContract(GetTemplateChild templateDiscovery, Action onAttached, Action onDetaching)
     : this(new TemplateContractBinder(templateDiscovery), onAttached, onDetaching)
 {
 }
Example #6
0
 public TemplateContract(GetTemplateChild templateDiscovery)
     : this(new TemplateContractBinder(templateDiscovery), null, null)
 {
 }
Example #7
0
 public FloatLayoutTemplateContract(GetTemplateChild templateDiscovery)
     : base(templateDiscovery)
 {
 }
Example #8
0
 public ButtonSpinnerTemplateContract(GetTemplateChild templateDiscovery, Action onAttach, Action onDetach)
     : base(templateDiscovery, onAttach, onDetach)
 {
 }