public ucEducationDetailView(string mode,int educationID , Education edu = null)
 {
     InitializeComponent();
     FormMode = mode;
     _educationID = educationID;
     UserEducation = edu;
     ViewModeGenericWork();
 }
 private void EducationDetailView_Loaded(object sender, RoutedEventArgs e)
 {
     if (UserEducation != null && FormMode == FormModes.New)
         return;
     if(FormMode != FormModes.New)
     {
         UserEducation = EducationRepo.FindByID(_educationID);
     }
 }
 private void OpenEducationDetailWindow(string mode, string title)
 {
     var win = (Education)gvEducationListView.SelectedItem;
     if (win == null && mode != FormModes.New)
     {
         Message(MessageTypes.Error, "Please Select to edit");
         return;
     }
     ucEducationDetailView view;
     if (win != null && win.EducationID == 0)
     {
         view = new ucEducationDetailView(FormModes.New, win.EducationID, win);
     }
     else
     {
         if (win == null)
         {
             win = new Education();
         }
         view = new ucEducationDetailView(FormModes.New, win.EducationID);
     }
     view.ParentContainer = this;
     OpenPopUp(view, title, 500, 260);
 }
        internal void UpdateEducationList(Education edu)
        {
            List<Education> eduList = new List<Education>();
            foreach (Education e in EducationList)
            {
                if (e.EducationID == edu.EducationID)
                {
                    eduList.Add(edu);
                }
                else
                {
                    eduList.Add(e);
                }
            }
            EducationList = eduList as IEnumerable<Education>;

        }
 internal void AddToEducationList(Education edu)
 {
     EducationList = EducationList.Add(edu);
 }