Button myButton = new Button(); myButton.Content = "Click Me"; myButton.Click += MyButton_Click;
In this example, we define a button control in XAML and set its content to "Click Me". We also add a Click event handler which will be triggered when the button is clicked. Package/Library: The package/library for this class is the Windows.UI.Xaml.Controls package.