Browse Source
...during ApplyTemplate. This was so that ItemsControls could their find ItemsPresenters nested in other templated controls. Instead use IItemsPresenterHost to make the presenter register itself with its TemplatedParent.pull/316/merge
31 changed files with 403 additions and 179 deletions
@ -0,0 +1,27 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using Perspex.Styling; |
|||
|
|||
namespace Perspex.Controls.Presenters |
|||
{ |
|||
/// <summary>
|
|||
/// Represents a control which hosts an items presenter.
|
|||
/// </summary>
|
|||
/// <remarks>
|
|||
/// This interface is implemented by <see cref="ItemsControl"/> which usually contains an
|
|||
/// <see cref="ItemsPresenter"/> and exposes it through its
|
|||
/// <see cref="ItemsControl.Presenter"/> property. ItemsPresenters can be within
|
|||
/// nested templates or in popups and so are not necessarily created immediately when the
|
|||
/// parent control's template is instantiated so they register themselves using this
|
|||
/// interface.
|
|||
/// </remarks>
|
|||
public interface IItemsPresenterHost : ITemplatedControl |
|||
{ |
|||
/// <summary>
|
|||
/// Registers an <see cref="IItemsPresenter"/> with a host control.
|
|||
/// </summary>
|
|||
/// <param name="presenter">The items presenter.</param>
|
|||
void RegisterItemsPresenter(IItemsPresenter presenter); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue