public void UpdateChildControlAsNewDataLoaded() { SetupListData(); if (App.ILRMessage.LearnerList.Count > 0) { LearnerItemsCV.MoveCurrentToFirst(); (LearnerItemsCV.CurrentItem as ILR.Learner).IsSelected = true; } }
public void UpdateChildControlAsNewDataLoaded() { SetupListData(); if (App.ILRMessage.LearnerList.Count > 0) { LearnerItemsCV.MoveCurrentToFirst(); OnPropertyChanged("LearnerItemsCV"); } }
public void UpdateChildControlAsNewDataLoaded() { SetupListData(); if (App.ILRMessage.LearnerList.Count > 0) { // LearnerItemsCV.Refresh(); LearnerItemsCV.MoveCurrentToFirst(); //(LearnerItemsCV.CurrentItem as ILR.Learner).IsSelected = true; OnPropertyChanged("LearnerItemsCV"); } }
private void RemoveLearner_Click(object sender, RoutedEventArgs e) { if (LearnerItemsCV.CurrentItem != null) { Learner lr2Remove = LearnerItemsCV.CurrentItem as Learner; if (lr2Remove != null) { MessageBoxResult result = MessageBox.Show(String.Format("Are you sure you want to delete Learner {0} {0} Learner Ref - {3} {0} Name : {1} {2}", Environment.NewLine, lr2Remove.GivenNames, lr2Remove.FamilyName, lr2Remove.LearnRefNumber) , "Confirmation" , MessageBoxButton.YesNo , MessageBoxImage.Stop , MessageBoxResult.No); if (result == MessageBoxResult.Yes) { //int currentPost = LearnerItemsCV.CurrentPosition; App.ILRMessage.Delete(lr2Remove); App.ILRMessage.Save(); LearnerItemsCV.Refresh(); if (App.ILRMessage.LearnerList.Count > 0) { if (!LearnerItemsCV.MoveCurrentToPrevious()) { LearnerItemsCV.MoveCurrentToFirst(); LearnerItemsCV.Refresh(); OnPropertyChanged("LearnerItemsCV"); } if ((LearnerItemsCV.CurrentItem != null) && (LearnerItemsCV.CurrentItem != lr2Remove)) { Learner lr = LearnerItemsCV.CurrentItem as Learner; lr.IsSelected = true; } else { LearnerItemsCV.MoveCurrentToNext(); if (LearnerItemsCV.CurrentItem != null) { Learner lr = LearnerItemsCV.CurrentItem as Learner; lr.IsSelected = true; } } LearnerItemsCV.Refresh(); OnPropertyChanged("LearnerItemsCV"); } else { SetupListData(); } } } } }