void RegisterClipboardContentChanged_Click(object sender, RoutedEventArgs e) { if (OtherScenarios.registerContentChanged != RegisterClipboardContentChanged.IsChecked.Value) { this.ClearOutput(); OtherScenarios.registerContentChanged = RegisterClipboardContentChanged.IsChecked.Value; // In this sample, we register for Clipboard update notifications on the MainPage so that we can // navigate between scenarios and still receive updates. The sample also registers for window activated // notifications since the app needs to be in the foreground to access the clipboard. Once we receive // a clipboard update notification, we display the new content (if the app is in the foreground). If the // sample is not in the foreground, we defer displaying it until it is. rootPage.EnableClipboardContentChangedNotifications(OtherScenarios.registerContentChanged); if (OtherScenarios.registerContentChanged) { OutputText.Text = "Successfully registered for clipboard update notification."; } else { OutputText.Text = "Successfully un-registered for clipboard update notification."; } } }