/// <summary> /// Applies the display data template. /// </summary> /// <param name="uiElement">Corresponding Renderer Element</param> /// <param name="templateColumn">TreeGridColumn - Column which is providing the information for Binding </param> /// <param name="dataContext">The data context.</param> private void InitializeDisplayTemplate(ContentControl uiElement, TreeGridTemplateColumn templateColumn, object dataContext) { if (templateColumn.TreeGrid != null && templateColumn.TreeGrid.CellTemplateSelector != null) { uiElement.ContentTemplateSelector = templateColumn.TreeGrid.CellTemplateSelector; } }
/// <summary> /// Applies the edit data template. /// </summary> /// <param name="uiElement">The unique identifier element.</param> /// <param name="templateColumn">The template column.</param> /// <param name="dataContext">The data context.</param> private void InitializeEditTemplate(ContentControl uiElement, TreeGridTemplateColumn templateColumn, object dataContext) { if (templateColumn.hasEditTemplate) { uiElement.ContentTemplate = templateColumn.EditTemplate; } else if (templateColumn.hasEditTemplateSelector) { uiElement.ContentTemplateSelector = templateColumn.EditTemplateSelector; #if UWP //UWP-3838 DataTemplates are not loaded when using ContentTemplateSelector in UWP. //By using ContentTemplate the DataTemplates are loaded. uiElement.ContentTemplate = templateColumn.EditTemplateSelector.SelectTemplate(dataContext, uiElement); #endif } }