private async void DeleteAll(object sender, RoutedEventArgs e) { // Get the attached flyout var replyFlyout = (Flyout)Resources["DeleteFlyout"]; if (replyFlyout == null) { return; } replyFlyout.Hide(); await SampleDataSource.ClearList(); }