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.
 
 
 

37 lines
1.0 KiB

using System;
using System.Windows.Forms;
using ControlCatalog;
using AvaloniaButton = Avalonia.Controls.Button;
using AvaloniaStackPanel = Avalonia.Controls.StackPanel;
using AvaloniaTextBox = Avalonia.Controls.TextBox;
using AvaloniaWindow = Avalonia.Controls.Window;
namespace WindowsInteropTest
{
public partial class EmbedToWinFormsDemo : Form
{
public EmbedToWinFormsDemo()
{
InitializeComponent();
avaloniaHost.Content = new MainView();
}
private void OpenWindowButton_Click(object sender, EventArgs e)
{
var window = new AvaloniaWindow
{
Width = 300,
Height = 300,
Content = new AvaloniaStackPanel
{
Children =
{
new AvaloniaButton { Content = "Button" },
new AvaloniaTextBox { Text = "Text" }
}
}
};
window.Show();
}
}
}