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); } } }
public TemplateContractBinder(FrameworkElement frameworkElement) { _templateChildProvider = new TemplateDiscovery(frameworkElement).GetChild; }
public TemplateContractBinder(GetTemplateChild templateChildProvider) { _templateChildProvider = templateChildProvider; }
public UpDownBaseTemplateContract(GetTemplateChild templateDiscovery, Action onAttach, Action onDetach) : base(templateDiscovery, onAttach, onDetach) { }
public TemplateContract(GetTemplateChild templateDiscovery, Action onAttached, Action onDetaching) : this(new TemplateContractBinder(templateDiscovery), onAttached, onDetaching) { }
public TemplateContract(GetTemplateChild templateDiscovery) : this(new TemplateContractBinder(templateDiscovery), null, null) { }
public FloatLayoutTemplateContract(GetTemplateChild templateDiscovery) : base(templateDiscovery) { }
public ButtonSpinnerTemplateContract(GetTemplateChild templateDiscovery, Action onAttach, Action onDetach) : base(templateDiscovery, onAttach, onDetach) { }