Browse Source
Added an `IDataTemplateHost` interface with a `IsDataTemplatesInitialized` property to prevent the need for allocating empty `DataTemplates` collections for many controls.pull/1135/head
13 changed files with 82 additions and 53 deletions
@ -0,0 +1,27 @@ |
|||
// Copyright (c) The Avalonia Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
|
|||
namespace Avalonia.Controls.Templates |
|||
{ |
|||
/// <summary>
|
|||
/// Defines an element that has a <see cref="DataTemplates"/> collection.
|
|||
/// </summary>
|
|||
public interface IDataTemplateHost |
|||
{ |
|||
/// <summary>
|
|||
/// Gets the data templates for the element.
|
|||
/// </summary>
|
|||
DataTemplates DataTemplates { get; } |
|||
|
|||
/// <summary>
|
|||
/// Gets a value indicating whether <see cref="DataTemplates"/> is initialized.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// The <see cref="DataTemplates"/> property may be lazily initialized, if so this property
|
|||
/// indicates whether it has been initialized.
|
|||
/// </remarks>
|
|||
bool IsDataTemplatesInitialized { get; } |
|||
} |
|||
} |
|||
Loading…
Reference in new issue