using Microsoft.Toolkit.Wpf.UI.XamlHost;
using System;
using System.Windows;

namespace WpfApp3
{
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void WindowsXamlHost_ChildChanged(object sender, EventArgs e)
        {
            WindowsXamlHost windowsXamlHost = (WindowsXamlHost)sender;

            Windows.UI.Xaml.Controls.Button button =
                (Windows.UI.Xaml.Controls.Button)windowsXamlHost.Child;

            button.Content = "My UWP button";
            button.Click += Button_Click;
        }

        private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            MessageBox.Show("My UWP button works");
        }
    }
}
