|
@@ -285,6 +285,11 @@ namespace Avalonia.Controls
|
|
|
/// </summary>
|
|
|
public event EventHandler? Closed;
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// Gets or sets a method called when the TopLevel's scaling changes.
|
|
|
+ /// </summary>
|
|
|
+ public event EventHandler? ScalingChanged;
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// Gets or sets the client size of the window.
|
|
|
/// </summary>
|
|
@@ -428,7 +433,7 @@ namespace Avalonia.Controls
|
|
|
double ILayoutRoot.LayoutScaling => PlatformImpl?.RenderScaling ?? 1;
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
- double IRenderRoot.RenderScaling => PlatformImpl?.RenderScaling ?? 1;
|
|
|
+ public double RenderScaling => PlatformImpl?.RenderScaling ?? 1;
|
|
|
|
|
|
IStyleHost IStyleHost.StylingParent => _globalStyles!;
|
|
|
|
|
@@ -590,6 +595,7 @@ namespace Avalonia.Controls
|
|
|
protected virtual void HandleScalingChanged(double scaling)
|
|
|
{
|
|
|
LayoutHelper.InvalidateSelfAndChildrenMeasure(this);
|
|
|
+ ScalingChanged?.Invoke(this, EventArgs.Empty);
|
|
|
}
|
|
|
|
|
|
private static bool TransparencyLevelsMatch (WindowTransparencyLevel requested, WindowTransparencyLevel received)
|