Skip to content

Commit

Permalink
Merge pull request #7701 from AvaloniaUI/fixes/7573-remove-validating…
Browse files Browse the repository at this point in the history
…-layer

Removed TopLevelImpl validating layer.
  • Loading branch information
maxkatz6 authored Feb 25, 2022
2 parents 237a9a4 + bdd576b commit cf40772
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 361 deletions.
2 changes: 1 addition & 1 deletion src/Avalonia.Controls/Primitives/PopupRoot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public PopupRoot(TopLevel parent, IPopupImpl impl)
/// The dependency resolver to use. If null the default dependency resolver will be used.
/// </param>
public PopupRoot(TopLevel parent, IPopupImpl impl, IAvaloniaDependencyResolver? dependencyResolver)
: base(ValidatingPopupImpl.Wrap(impl), dependencyResolver)
: base(impl, dependencyResolver)
{
_parent = parent;
}
Expand Down
2 changes: 0 additions & 2 deletions src/Avalonia.Controls/TopLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ public TopLevel(ITopLevelImpl impl, IAvaloniaDependencyResolver? dependencyResol
"Could not create window implementation: maybe no windowing subsystem was initialized?");
}

impl = ValidatingToplevelImpl.Wrap(impl);

PlatformImpl = impl;

_actualTransparencyLevel = PlatformImpl.TransparencyLevel;
Expand Down
344 changes: 0 additions & 344 deletions src/Avalonia.Controls/ValidatingToplevel.cs

This file was deleted.

11 changes: 5 additions & 6 deletions src/Avalonia.Controls/Window.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,13 @@ public Window()
/// </summary>
/// <param name="impl">The window implementation.</param>
public Window(IWindowImpl impl)
: base(ValidatingWindowImpl.Wrap(impl))
: base(impl)
{
var wrapped = (IWindowImpl)base.PlatformImpl!;
wrapped.Closing = HandleClosing;
wrapped.GotInputWhenDisabled = OnGotInputWhenDisabled;
wrapped.WindowStateChanged = HandleWindowStateChanged;
impl.Closing = HandleClosing;
impl.GotInputWhenDisabled = OnGotInputWhenDisabled;
impl.WindowStateChanged = HandleWindowStateChanged;
_maxPlatformClientSize = PlatformImpl?.MaxAutoSizeHint ?? default(Size);
wrapped.ExtendClientAreaToDecorationsChanged = ExtendClientAreaToDecorationsChanged;
impl.ExtendClientAreaToDecorationsChanged = ExtendClientAreaToDecorationsChanged;
this.GetObservable(ClientSizeProperty).Skip(1).Subscribe(x => PlatformImpl?.Resize(x, PlatformResizeReason.Application));

PlatformImpl?.ShowTaskbarIcon(ShowInTaskbar);
Expand Down
Loading

0 comments on commit cf40772

Please sign in to comment.