Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Avalonia.Controls/ContentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Avalonia.Controls
/// <summary>
/// Displays <see cref="Content"/> according to an <see cref="IDataTemplate"/>.
/// </summary>
[TemplatePart("PART_ContentPresenter", typeof(IContentPresenter))]
[TemplatePart("PART_ContentPresenter", typeof(ContentPresenter))]
public class ContentControl : TemplatedControl, IContentControl, IContentPresenterHost
{
/// <summary>
Expand Down Expand Up @@ -68,7 +68,7 @@ public IDataTemplate? ContentTemplate
/// <summary>
/// Gets the presenter from the control's template.
/// </summary>
public IContentPresenter? Presenter
public ContentPresenter? Presenter
{
get;
private set;
Expand Down Expand Up @@ -96,16 +96,16 @@ public VerticalAlignment VerticalContentAlignment
IAvaloniaList<ILogical> IContentPresenterHost.LogicalChildren => LogicalChildren;

/// <inheritdoc/>
bool IContentPresenterHost.RegisterContentPresenter(IContentPresenter presenter)
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter)
{
return RegisterContentPresenter(presenter);
}

/// <summary>
/// Called when an <see cref="IContentPresenter"/> is registered with the control.
/// Called when an <see cref="ContentPresenter"/> is registered with the control.
/// </summary>
/// <param name="presenter">The presenter.</param>
protected virtual bool RegisterContentPresenter(IContentPresenter presenter)
protected virtual bool RegisterContentPresenter(ContentPresenter presenter)
{
if (presenter.Name == "PART_ContentPresenter")
{
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Presenters/ContentPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Avalonia.Controls.Presenters
/// Presents a single item of data inside a <see cref="TemplatedControl"/> template.
/// </summary>
[PseudoClasses(":empty")]
public class ContentPresenter : Control, IContentPresenter
public class ContentPresenter : Control
{
/// <summary>
/// Defines the <see cref="Background"/> property.
Expand Down
23 changes: 0 additions & 23 deletions src/Avalonia.Controls/Presenters/IContentPresenter.cs

This file was deleted.

4 changes: 2 additions & 2 deletions src/Avalonia.Controls/Presenters/IContentPresenterHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ internal interface IContentPresenterHost
IAvaloniaList<ILogical> LogicalChildren { get; }

/// <summary>
/// Registers an <see cref="IContentPresenter"/> with a host control.
/// Registers an <see cref="ContentPresenter"/> with a host control.
/// </summary>
/// <param name="presenter">The content presenter.</param>
/// <returns>
/// True if the content presenter should add its child to the logical children of the
/// host; otherwise false.
/// </returns>
bool RegisterContentPresenter(IContentPresenter presenter);
bool RegisterContentPresenter(ContentPresenter presenter);
}
}
20 changes: 0 additions & 20 deletions src/Avalonia.Controls/Presenters/IPresenter.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Avalonia.Controls.Presenters
/// <summary>
/// Presents a scrolling view of content inside a <see cref="ScrollViewer"/>.
/// </summary>
public class ScrollContentPresenter : ContentPresenter, IPresenter, IScrollable, IScrollAnchorProvider
public class ScrollContentPresenter : ContentPresenter, IScrollable, IScrollAnchorProvider
{
private const double EdgeDetectionTolerance = 0.1;

Expand Down
4 changes: 2 additions & 2 deletions src/Avalonia.Controls/Primitives/HeaderedContentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public object? Header
/// <summary>
/// Gets the header presenter from the control's template.
/// </summary>
public IContentPresenter? HeaderPresenter
public ContentPresenter? HeaderPresenter
{
get;
private set;
Expand All @@ -57,7 +57,7 @@ public IDataTemplate? HeaderTemplate
}

/// <inheritdoc/>
protected override bool RegisterContentPresenter(IContentPresenter presenter)
protected override bool RegisterContentPresenter(ContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

Expand Down
8 changes: 4 additions & 4 deletions src/Avalonia.Controls/Primitives/HeaderedItemsControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public IDataTemplate? HeaderTemplate
/// <summary>
/// Gets the header presenter from the control's template.
/// </summary>
public IContentPresenter? HeaderPresenter
public ContentPresenter? HeaderPresenter
{
get;
private set;
Expand All @@ -77,16 +77,16 @@ protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e
}

/// <inheritdoc/>
bool IContentPresenterHost.RegisterContentPresenter(IContentPresenter presenter)
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter)
{
return RegisterContentPresenter(presenter);
}

/// <summary>
/// Called when an <see cref="IContentPresenter"/> is registered with the control.
/// Called when an <see cref="ContentPresenter"/> is registered with the control.
/// </summary>
/// <param name="presenter">The presenter.</param>
protected virtual bool RegisterContentPresenter(IContentPresenter presenter)
protected virtual bool RegisterContentPresenter(ContentPresenter presenter)
{
if (presenter.Name == "PART_HeaderPresenter")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public IDataTemplate? HeaderTemplate
/// <summary>
/// Gets the header presenter from the control's template.
/// </summary>
public IContentPresenter? HeaderPresenter
public ContentPresenter? HeaderPresenter
{
get;
private set;
Expand All @@ -66,7 +66,7 @@ public IContentPresenter? HeaderPresenter
IAvaloniaList<ILogical> IContentPresenterHost.LogicalChildren => LogicalChildren;

/// <inheritdoc/>
bool IContentPresenterHost.RegisterContentPresenter(IContentPresenter presenter)
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter)
{
return RegisterContentPresenter(presenter);
}
Expand All @@ -83,10 +83,10 @@ protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e
}

/// <summary>
/// Called when an <see cref="IContentPresenter"/> is registered with the control.
/// Called when an <see cref="ContentPresenter"/> is registered with the control.
/// </summary>
/// <param name="presenter">The presenter.</param>
protected virtual bool RegisterContentPresenter(IContentPresenter presenter)
protected virtual bool RegisterContentPresenter(ContentPresenter presenter)
{
if (presenter.Name == "PART_HeaderPresenter")
{
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Primitives/IPopupHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface IPopupHost : IDisposable, IFocusScope
/// <summary>
/// Gets the presenter from the control's template.
/// </summary>
IContentPresenter? Presenter { get; }
ContentPresenter? Presenter { get; }

/// <summary>
/// Gets or sets whether the popup appears on top of all other windows.
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/ScrollViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,7 @@ public void UnregisterAnchorCandidate(Control element)
(Presenter as IScrollAnchorProvider)?.UnregisterAnchorCandidate(element);
}

protected override bool RegisterContentPresenter(IContentPresenter presenter)
protected override bool RegisterContentPresenter(ContentPresenter presenter)
{
_childSubscription?.Dispose();
_childSubscription = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/SplitView/SplitView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ public event EventHandler<CancelRoutedEventArgs>? PaneOpening
remove => RemoveHandler(PaneOpeningEvent, value);
}

protected override bool RegisterContentPresenter(IContentPresenter presenter)
protected override bool RegisterContentPresenter(ContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

Expand Down
8 changes: 4 additions & 4 deletions src/Avalonia.Controls/TabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ public IDataTemplate? SelectedContentTemplate

internal ItemsPresenter? ItemsPresenterPart { get; private set; }

internal IContentPresenter? ContentPart { get; private set; }
internal ContentPresenter? ContentPart { get; private set; }

/// <inheritdoc/>
IAvaloniaList<ILogical> IContentPresenterHost.LogicalChildren => LogicalChildren;

/// <inheritdoc/>
bool IContentPresenterHost.RegisterContentPresenter(IContentPresenter presenter)
bool IContentPresenterHost.RegisterContentPresenter(ContentPresenter presenter)
{
return RegisterContentPresenter(presenter);
}
Expand Down Expand Up @@ -210,10 +210,10 @@ private void UpdateSelectedContent(Control? container = null)
}

/// <summary>
/// Called when an <see cref="IContentPresenter"/> is registered with the control.
/// Called when an <see cref="ContentPresenter"/> is registered with the control.
/// </summary>
/// <param name="presenter">The presenter.</param>
protected virtual bool RegisterContentPresenter(IContentPresenter presenter)
protected virtual bool RegisterContentPresenter(ContentPresenter presenter)
{
if (presenter.Name == "PART_SelectedContentHost")
{
Expand Down
6 changes: 3 additions & 3 deletions src/Avalonia.Controls/ToggleSwitch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ public object? OffContent
set { SetValue(OffContentProperty, value); }
}

public IContentPresenter? OffContentPresenter
public ContentPresenter? OffContentPresenter
{
get;
private set;
}

public IContentPresenter? OnContentPresenter
public ContentPresenter? OnContentPresenter
{
get;
private set;
Expand Down Expand Up @@ -142,7 +142,7 @@ private void OnContentChanged(AvaloniaPropertyChangedEventArgs e)
}
}

protected override bool RegisterContentPresenter(IContentPresenter presenter)
protected override bool RegisterContentPresenter(ContentPresenter presenter)
{
var result = base.RegisterContentPresenter(presenter);

Expand Down
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/TransitioningContentControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PageTransition is { } transition &&
return result;
}

protected override bool RegisterContentPresenter(IContentPresenter presenter)
protected override bool RegisterContentPresenter(ContentPresenter presenter)
{
if (!base.RegisterContentPresenter(presenter) &&
presenter is ContentPresenter p &&
Expand Down
Loading