Browse Source

Move MaxClientSize to ITopLevelImpl.

This allows the maximum size calculation constraint to be applied when
an `ItemsPresenter` is in a `Popup`, meaning that all items don't get
materialized when the popup is shown. Fixes #719, hopefully.
pull/710/head
Steven Kirk 10 years ago
parent
commit
2ab8941426
  1. 5
      src/Avalonia.Controls/Platform/ITopLevelImpl.cs
  2. 5
      src/Avalonia.Controls/Platform/IWindowImpl.cs
  3. 2
      src/Avalonia.Controls/Presenters/ItemsPresenter.cs

5
src/Avalonia.Controls/Platform/ITopLevelImpl.cs

@ -22,6 +22,11 @@ namespace Avalonia.Platform
/// </summary> /// </summary>
Size ClientSize { get; set; } Size ClientSize { get; set; }
/// <summary>
/// Gets the maximum size of a window on the system.
/// </summary>
Size MaxClientSize { get; }
/// <summary> /// <summary>
/// Gets the scaling factor for the window. /// Gets the scaling factor for the window.
/// </summary> /// </summary>

5
src/Avalonia.Controls/Platform/IWindowImpl.cs

@ -11,11 +11,6 @@ namespace Avalonia.Platform
/// </summary> /// </summary>
public interface IWindowImpl : ITopLevelImpl public interface IWindowImpl : ITopLevelImpl
{ {
/// <summary>
/// Gets the maximum size of a window on the system.
/// </summary>
Size MaxClientSize { get; }
/// <summary> /// <summary>
/// Gets or sets the minimized/maximized state of the window. /// Gets or sets the minimized/maximized state of the window.
/// </summary> /// </summary>

2
src/Avalonia.Controls/Presenters/ItemsPresenter.cs

@ -99,7 +99,7 @@ namespace Avalonia.Controls.Presenters
// the available size. // the available size.
if (availableSize == Size.Infinity && VirtualizationMode != ItemVirtualizationMode.None) if (availableSize == Size.Infinity && VirtualizationMode != ItemVirtualizationMode.None)
{ {
var window = VisualRoot as Window; var window = VisualRoot as TopLevel;
if (window != null) if (window != null)
{ {

Loading…
Cancel
Save