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.
 
 
 

36 lines
1.0 KiB

using System;
using Avalonia.Controls.Embedding;
using Avalonia.Controls.Remote.Server;
using Avalonia.Platform;
using Avalonia.Remote.Protocol;
namespace Avalonia.Controls.Remote
{
public class RemoteServer
{
private EmbeddableControlRoot _topLevel;
class EmbeddableRemoteServerTopLevelImpl : RemoteServerTopLevelImpl
{
public EmbeddableRemoteServerTopLevelImpl(IAvaloniaRemoteTransportConnection transport) : base(transport)
{
}
#pragma warning disable 67
public Action LostFocus { get; set; }
}
public RemoteServer(IAvaloniaRemoteTransportConnection transport)
{
_topLevel = new EmbeddableControlRoot(new EmbeddableRemoteServerTopLevelImpl(transport));
_topLevel.Prepare();
//TODO: Somehow react on closed connection?
}
public object Content
{
get => _topLevel.Content;
set => _topLevel.Content = value;
}
}
}