1 type derived from DataTemplate
Microsoft.Maui.Controls (1)
DataTemplateSelector.cs (1)
8 public abstract class DataTemplateSelector : DataTemplate
6 instantiations of DataTemplate
Microsoft.Maui.Controls (4)
BindableLayout\BindableLayout.cs (1)
232 static readonly DataTemplate DefaultItemTemplate = new DataTemplate(() =>
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (1)
38 return _defaultTemplate ?? (_defaultTemplate = new DataTemplate(() =>
IndicatorView\IndicatorStackLayout.cs (1)
137 var indicatorTemplate = _indicatorView.IndicatorTemplate ??= new DataTemplate(() => new Border
Shell\BaseShellItem.cs (1)
353 return new DataTemplate(() =>
Microsoft.Maui.Controls.Xaml (2)
CreateValuesVisitor.cs (1)
92 value = new DataTemplate();
MarkupExtensions\DataTemplateExtension.cs (1)
26 return new DataTemplate(type);
206 references to DataTemplate
Microsoft.Maui.Controls (191)
BindableLayout\BindableLayout.cs (28)
27 BindableProperty.CreateAttached("ItemTemplate", typeof(DataTemplate), typeof(IBindableLayout), default(DataTemplate), 28 propertyChanged: (b, o, n) => { GetBindableLayoutController(b).ItemTemplate = (DataTemplate)n; }); 46 BindableProperty.Create("EmptyViewTemplate", typeof(DataTemplate), typeof(IBindableLayout), null, propertyChanged: (b, o, n) => { GetBindableLayoutController(b).EmptyViewTemplate = (DataTemplate)n; }); 61 public static void SetItemTemplate(BindableObject b, DataTemplate value) 67 public static DataTemplate GetItemTemplate(BindableObject b) 69 return (DataTemplate)b.GetValue(ItemTemplateProperty); 97 public static DataTemplate GetEmptyViewTemplate(BindableObject b) 99 return (DataTemplate)b.GetValue(EmptyViewTemplateProperty); 103 public static void SetEmptyViewTemplate(BindableObject b, DataTemplate value) 214 static readonly BindableProperty BindableLayoutTemplateProperty = BindableProperty.CreateAttached("BindableLayoutTemplate", typeof(DataTemplate), typeof(BindableLayoutController), default(DataTemplate)); 219 static DataTemplate GetBindableLayoutTemplate(BindableObject b) 221 return (DataTemplate)b.GetValue(BindableLayoutTemplateProperty); 227 static void SetBindableLayoutTemplate(BindableObject b, DataTemplate value) 232 static readonly DataTemplate DefaultItemTemplate = new DataTemplate(() => 243 DataTemplate _itemTemplate; 247 DataTemplate _emptyViewTemplate; 251 public DataTemplate ItemTemplate { get => _itemTemplate; set => SetItemTemplate(value); } 255 public DataTemplate EmptyViewTemplate { get => _emptyViewTemplate; set => SetEmptyViewTemplate(value); } 296 void SetItemTemplate(DataTemplate itemTemplate) 333 void SetEmptyViewTemplate(DataTemplate emptyViewTemplate) 466 DataTemplate SelectTemplate(object item, IBindableLayout layout) 471 View CreateEmptyView(object emptyView, DataTemplate dataTemplate) 542 var template = SelectTemplate(item, layout); 544 var currentTemplate = GetBindableLayoutTemplate(child); 558 static View CreateItemView(object item, DataTemplate dataTemplate)
Compatibility\Handlers\ListView\iOS\ListViewRenderer.cs (4)
985 Dictionary<DataTemplate, int> _templateToId = new Dictionary<DataTemplate, int>(); 1383 protected DataTemplate GetDataTemplateForPath(NSIndexPath indexPath) 1428 var itemTemplate = list.ItemTemplate;
Compatibility\Handlers\Shell\iOS\ShellSearchResultsRenderer.cs (3)
31 DataTemplate _defaultTemplate; 34 DataTemplate DefaultTemplate 114 var template = SearchHandler.ItemTemplate;
Compatibility\Handlers\Shell\iOS\ShellTableViewSource.cs (3)
49 protected virtual DataTemplate DefaultItemTemplate => null; 51 protected virtual DataTemplate DefaultMenuItemTemplate => null; 149 DataTemplate template = ShellController.GetFlyoutItemDataTemplate(context);
DataTemplateExtensions.cs (3)
11 public static DataTemplate SelectDataTemplate(this DataTemplate self, object item, BindableObject container) 21 public static object CreateContent(this DataTemplate self, object item, BindableObject container)
DataTemplateSelector.cs (5)
10 Dictionary<Type, DataTemplate> _dataTemplates = new Dictionary<Type, DataTemplate>(); 13 public DataTemplate SelectTemplate(object item, BindableObject container) 21 DataTemplate dataTemplate = null; 42 protected abstract DataTemplate OnSelectTemplate(object item, BindableObject container);
Handlers\Items\iOS\GroupableItemsViewController.cs (3)
105 DataTemplate template = elementKind == UICollectionElementKindSectionKey.Header 126 string DetermineViewReuseId(DataTemplate template) 164 internal CGSize GetReferenceSizeForheaderOrFooter(UICollectionView collectionView, DataTemplate template, NSString elementKind, nint section)
Handlers\Items\iOS\ItemsViewController.cs (2)
460 var dataTemplate = ItemsView.ItemTemplate.SelectDataTemplate(item, ItemsView); 577 internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement)
Handlers\Items\iOS\StructuredItemsViewController.cs (1)
161 internal void UpdateSubview(object view, DataTemplate viewTemplate, nint viewTag, ref UIView uiView, ref VisualElement formsElement)
Handlers\Items\iOS\TemplatedCell.cs (5)
32 WeakReference<DataTemplate> _currentTemplate; 34 public DataTemplate CurrentTemplate 36 get => _currentTemplate is not null && _currentTemplate.TryGetTarget(out var target) ? target : null; 151 public void Bind(DataTemplate template, object bindingContext, ItemsView itemsView) 156 var itemTemplate = template.SelectDataTemplate(bindingContext, itemsView);
Handlers\Items\iOS\TemplateHelpers.cs (1)
28 public static (UIView PlatformView, VisualElement FormsElement) RealizeView(object view, DataTemplate viewTemplate, ItemsView itemsView)
Handlers\Items2\CollectionViewHandler2.iOS.cs (2)
16 public DataTemplate FooterTemplate { get; set; } 17 public DataTemplate HeaderTemplate { get; set; }
Handlers\Items2\iOS\GroupableItemsViewController2.cs (2)
130 DataTemplate template = elementKind == UICollectionElementKindSectionKey.Header 146 string DetermineViewReuseId(DataTemplate template)
Handlers\Items2\iOS\ItemsViewController2.cs (2)
287 var dataTemplate = ItemsView.ItemTemplate.SelectDataTemplate(item, ItemsView); 323 internal void UpdateView(object view, DataTemplate viewTemplate, ref UIView uiView, ref VisualElement formsElement)
Handlers\Items2\iOS\StructuredItemsViewController2.cs (1)
142 string DetermineViewReuseId(DataTemplate template, object item)
Handlers\Items2\iOS\TemplatedCell2.cs (4)
35 WeakReference<DataTemplate> _currentTemplate; 37 public DataTemplate CurrentTemplate 39 get => _currentTemplate is not null && _currentTemplate.TryGetTarget(out var target) ? target : null; 110 public void Bind(DataTemplate template, object bindingContext, ItemsView itemsView)
IndicatorView\IndicatorStackLayout.cs (1)
137 var indicatorTemplate = _indicatorView.IndicatorTemplate ??= new DataTemplate(() => new Border
IndicatorView\IndicatorView.cs (4)
32 public static readonly BindableProperty IndicatorTemplateProperty = BindableProperty.Create(nameof(IndicatorTemplate), typeof(DataTemplate), typeof(IndicatorView), default(DataTemplate), propertyChanging: (bindable, oldValue, newValue) 92 public DataTemplate IndicatorTemplate 94 get => (DataTemplate)GetValue(IndicatorTemplateProperty);
ITemplatedItemsList.cs (1)
24 DataTemplate SelectDataTemplate(object item);
Items\GroupableItemsView.cs (8)
20 BindableProperty.Create(nameof(GroupHeaderTemplate), typeof(DataTemplate), typeof(GroupableItemsView), default(DataTemplate)); 23 public DataTemplate GroupHeaderTemplate 25 get => (DataTemplate)GetValue(GroupHeaderTemplateProperty); 31 BindableProperty.Create(nameof(GroupFooterTemplate), typeof(DataTemplate), typeof(GroupableItemsView), default(DataTemplate)); 34 public DataTemplate GroupFooterTemplate 36 get => (DataTemplate)GetValue(GroupFooterTemplateProperty);
Items\ItemsView.cs (6)
31 BindableProperty.Create(nameof(EmptyViewTemplate), typeof(DataTemplate), typeof(ItemsView), null); 34 public DataTemplate EmptyViewTemplate 36 get => (DataTemplate)GetValue(EmptyViewTemplateProperty); 132 BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(ItemsView)); 135 public DataTemplate ItemTemplate 137 get => (DataTemplate)GetValue(ItemTemplateProperty);
Items\StructuredItemsView.cs (6)
20 BindableProperty.Create(nameof(HeaderTemplate), typeof(DataTemplate), typeof(ItemsView), null); 23 public DataTemplate HeaderTemplate 25 get => (DataTemplate)GetValue(HeaderTemplateProperty); 42 BindableProperty.Create(nameof(FooterTemplate), typeof(DataTemplate), typeof(ItemsView), null); 45 public DataTemplate FooterTemplate 47 get => (DataTemplate)GetValue(FooterTemplateProperty);
ItemsView.cs (5)
31 BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(ItemsView<TVisual>), null, 32 validateValue: (b, v) => ((ItemsView<TVisual>)b).ValidateItemTemplate((DataTemplate)v)); 45 public DataTemplate ItemTemplate 47 get => (DataTemplate)GetValue(ItemTemplateProperty); 87 protected virtual bool ValidateItemTemplate(DataTemplate template) => true;
ListView\ListView.cs (15)
40 public static readonly BindableProperty HeaderTemplateProperty = BindableProperty.Create(nameof(HeaderTemplate), typeof(DataTemplate), typeof(ListView), null, propertyChanged: OnHeaderTemplateChanged, 47 public static readonly BindableProperty FooterTemplateProperty = BindableProperty.Create(nameof(FooterTemplate), typeof(DataTemplate), typeof(ListView), null, propertyChanged: OnFooterTemplateChanged, 64 public static readonly BindableProperty GroupHeaderTemplateProperty = BindableProperty.Create(nameof(GroupHeaderTemplate), typeof(DataTemplate), typeof(ListView), null, 135 public DataTemplate FooterTemplate 137 get { return (DataTemplate)GetValue(FooterTemplateProperty); } 174 public DataTemplate GroupHeaderTemplate 176 get { return (DataTemplate)GetValue(GroupHeaderTemplateProperty); } 212 public DataTemplate HeaderTemplate 214 get { return (DataTemplate)GetValue(HeaderTemplateProperty); } 629 lv.OnHeaderOrFooterChanged(ref lv._footerElement, "FooterElement", lv.Footer, (DataTemplate)newValue, true); 658 void OnHeaderOrFooterChanged(ref Element storage, string property, object dataObject, DataTemplate template, bool templateChanged) 703 lv.OnHeaderOrFooterChanged(ref lv._headerElement, "HeaderElement", lv.Header, (DataTemplate)newValue, true); 746 var template = (DataTemplate)value; 756 protected override bool ValidateItemTemplate(DataTemplate template)
MultiPage.cs (3)
22 public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(MultiPage<>), null); 49 public DataTemplate ItemTemplate 51 get { return (DataTemplate)GetValue(ItemTemplateProperty); }
Shell\BaseShellItem.cs (1)
351 internal static DataTemplate CreateDefaultFlyoutItemCell(BindableObject bo)
Shell\IShellController.cs (1)
59 DataTemplate GetFlyoutItemDataTemplate(BindableObject bo);
Shell\SearchHandler.cs (3)
381 BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(SearchHandler), null, BindingMode.OneTime); 525 public DataTemplate ItemTemplate 527 get { return (DataTemplate)GetValue(ItemTemplateProperty); }
Shell\Shell.cs (54)
148 BindableProperty.CreateAttached(nameof(MenuItemTemplate), typeof(DataTemplate), typeof(Shell), null, BindingMode.OneTime); 151 /// Gets the <see cref = "DataTemplate" /> applied to <see cref = "MenuItem" /> objects in the MenuItems collection. 153 /// <param name="obj">The object to get the <see cref="DataTemplate"/> from.</param> 154 /// <returns>The <see cref = "DataTemplate" /> applied to <paramref name="obj"/>.</returns> 155 public static DataTemplate GetMenuItemTemplate(BindableObject obj) => (DataTemplate)obj.GetValue(MenuItemTemplateProperty); 158 /// Sets the <see cref = "DataTemplate" /> applied to <see cref = "MenuItem" /> objects in the MenuItems collection. 164 /// <param name="obj">The object that sets the <see cref = "DataTemplate" /> applied to <see cref = "MenuItem" /> objects.</param> 165 /// <param name="menuItemTemplate">The <see cref = "DataTemplate" /> applied to <see cref = "MenuItem" /> objects.</param> 166 public static void SetMenuItemTemplate(BindableObject obj, DataTemplate menuItemTemplate) => obj.SetValue(MenuItemTemplateProperty, menuItemTemplate); 169 /// The <see cref = "DataTemplate" /> applied to each <see cref = "FlyoutItem" /> object managed by Shell. 172 BindableProperty.CreateAttached(nameof(ItemTemplate), typeof(DataTemplate), typeof(Shell), null, BindingMode.OneTime); 175 /// Gets the <see cref = "DataTemplate" /> applied to each <see cref = "FlyoutItem" /> object managed by Shell. 177 /// <param name="obj">The object that sets the <see cref = "DataTemplate" /> applied to Item objects.</param> 178 /// <returns>The <see cref = "DataTemplate" /> applied to Item objects.</returns> 179 public static DataTemplate GetItemTemplate(BindableObject obj) => (DataTemplate)obj.GetValue(ItemTemplateProperty); 182 /// Sets the <see cref = "DataTemplate" /> applied to each <see cref = "FlyoutItem" /> object managed by Shell. 184 /// <param name="obj">The object that sets the <see cref = "DataTemplate" /> applied to Item objects.</param> 185 /// <param name="itemTemplate">The <see cref = "DataTemplate" /> applied to Item objects.</param> 186 public static void SetItemTemplate(BindableObject obj, DataTemplate itemTemplate) => obj.SetValue(ItemTemplateProperty, itemTemplate); 647 DataTemplate IShellController.GetFlyoutItemDataTemplate(BindableObject bo) 654 return (DataTemplate)bindableObjectWithTemplate.GetValue(bp); 659 return (DataTemplate)GetValue(bp); 1113 /// The flyout header appearance can be defined by setting a <see cref = "DataTemplate" />. 1116 BindableProperty.Create(nameof(FlyoutHeaderTemplate), typeof(DataTemplate), typeof(Shell), null, BindingMode.OneTime, 1120 /// The flyout footer appearance can be defined by setting a <see cref = "DataTemplate" />. 1123 BindableProperty.Create(nameof(FlyoutFooterTemplate), typeof(DataTemplate), typeof(Shell), null, BindingMode.OneTime, 1419 /// Gets or sets the flyout header appearance using a <see cref = "DataTemplate" />. 1421 public DataTemplate FlyoutHeaderTemplate 1423 get => (DataTemplate)GetValue(FlyoutHeaderTemplateProperty); 1428 /// Gets or sets the flyout footer appearance using a <see cref = "DataTemplate" />. 1430 public DataTemplate FlyoutFooterTemplate 1432 get => (DataTemplate)GetValue(FlyoutFooterTemplateProperty); 1450 /// Gets or sets <see cref = "DataTemplate" /> applied to each of the Items. 1452 public DataTemplate ItemTemplate 1459 /// Gets or sets the <see cref = "DataTemplate" /> applied to MenuItem objects in the MenuItems collection. 1461 public DataTemplate MenuItemTemplate 1741 shell.OnFlyoutHeaderTemplateChanged((DataTemplate)oldValue, (DataTemplate)newValue); 1747 shell.OnFlyoutFooterTemplateChanged((DataTemplate)oldValue, (DataTemplate)newValue); 1885 void OnFlyoutHeaderTemplateChanged(DataTemplate oldValue, DataTemplate newValue) 1906 void OnFlyoutFooterTemplateChanged(DataTemplate oldValue, DataTemplate newValue) 2017 /// The flyout content can be defined by setting a <see cref = "DataTemplate" />. 2021 BindableProperty.Create(nameof(FlyoutContentTemplate), typeof(DataTemplate), typeof(Shell), null, BindingMode.OneTime, propertyChanging: OnFlyoutContentTemplateChanging); 2031 public DataTemplate FlyoutContentTemplate 2033 get => (DataTemplate)GetValue(FlyoutContentTemplateProperty); 2052 void OnFlyoutContentTemplateChanged(DataTemplate oldValue, DataTemplate newValue) 2072 shell.OnFlyoutContentTemplateChanged((DataTemplate)oldValue, (DataTemplate)newValue);
Shell\ShellContent.cs (4)
30 BindableProperty.Create(nameof(ContentTemplate), typeof(DataTemplate), typeof(ShellContent), null, BindingMode.OneTime); 46 public DataTemplate ContentTemplate 48 get => (DataTemplate)GetValue(ContentTemplateProperty); 60 var template = ContentTemplate;
Shell\ShellTemplatedViewManager.cs (2)
29 DataTemplate currentViewTemplate, 45 DataTemplate newViewTemplate,
TemplatedItemsList.cs (7)
50 DataTemplate _groupHeaderTemplate; 115 public DataTemplate GroupHeaderTemplate 119 DataTemplate groupHeader = null; 121 groupHeader = (DataTemplate)_itemsView.GetValue(GroupHeaderTemplateProperty); 211 DataTemplate ItemTemplate 213 get { return (DataTemplate)_itemsView.GetValue(_itemTemplateProperty); } 535 public DataTemplate SelectDataTemplate(object item)
TemplateExtensions.cs (1)
12 public static void SetBinding(this DataTemplate self, BindableProperty targetProperty, string path)
Microsoft.Maui.Controls.Build.Tasks (1)
SetPropertiesVisitor.cs (1)
467 if (n.XmlType.Name == nameof(Microsoft.Maui.Controls.DataTemplate)
Microsoft.Maui.Controls.Maps (10)
Map.cs (10)
38 public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create(nameof(ItemTemplate), typeof(DataTemplate), typeof(Map), default(DataTemplate), 39 propertyChanged: (b, o, n) => ((Map)b).OnItemTemplatePropertyChanged((DataTemplate)o, (DataTemplate)n)); 146 public DataTemplate ItemTemplate 148 get { return (DataTemplate)GetValue(ItemTemplateProperty); } 283 void OnItemTemplatePropertyChanged(DataTemplate oldItemTemplate, DataTemplate newItemTemplate) 288 $"The {nameof(Map)}.{ItemTemplateProperty.PropertyName} property only supports {nameof(DataTemplate)}." + 328 DataTemplate? itemTemplate = ItemTemplate;
Microsoft.Maui.Controls.Xaml (4)
CreateValuesVisitor.cs (1)
91 if (type == typeof(DataTemplate))
MarkupExtensions\DataTemplateExtension.cs (3)
9 public sealed class DataTemplateExtension : IMarkupExtension<DataTemplate> 13 public DataTemplate ProvideValue(IServiceProvider serviceProvider) 34 return (this as IMarkupExtension<DataTemplate>).ProvideValue(serviceProvider);