Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Created November 3, 2018 10:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christiannagel/cfddfe878c9e24ceefdc8b95ebe2fd5d to your computer and use it in GitHub Desktop.
Save christiannagel/cfddfe878c9e24ceefdc8b95ebe2fd5d to your computer and use it in GitHub Desktop.
Access the UWP control from a XAML island
private void OnHostChildChanged(object sender, EventArgs e)
{
if (sender is WindowsXamlHost host && host.Child is UWPControls.Button button)
{
button.Content = "My UWP Button";
button.Click += (sender1, e1) =>
{
MessageBox.Show("UWP button clicked");
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment