A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

40 lines
960 B

using System;
using System.ComponentModel;
using Avalonia.Styling;
namespace Avalonia.Controls.Embedding.Offscreen
{
class OffscreenTopLevel : TopLevel
{
public OffscreenTopLevelImplBase Impl { get; }
public OffscreenTopLevel(OffscreenTopLevelImplBase impl) : base(impl)
{
Impl = impl;
Prepare();
}
public void Prepare()
{
EnsureInitialized();
ApplyTemplate();
LayoutManager.ExecuteInitialLayoutPass();
}
private void EnsureInitialized()
{
if (!this.IsInitialized)
{
var init = (ISupportInitialize)this;
init.BeginInit();
init.EndInit();
}
}
protected override Type StyleKeyOverride => typeof(EmbeddableControlRoot);
public void Dispose()
{
PlatformImpl?.Dispose();
}
}
}