private void OnSortClick(object sender, RoutedEventArgs e) { var sortButton = sender as Button; if (sortButton == null) { return; } MenuFlyout menuFlyout = DialogService.CreateInviteContactsSortMenu(this.ViewModel.AwardClass.Contacts); if (menuFlyout == null) { return; } menuFlyout.Placement = FlyoutPlacementMode.Bottom; menuFlyout.ShowAt(sortButton); }