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>
Size ClientSize { get; set; }
/// <summary>
/// Gets the maximum size of a window on the system.
/// </summary>
Size MaxClientSize { get; }
/// <summary>
/// Gets the scaling factor for the window.
/// </summary>

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

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

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

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

Loading…
Cancel
Save