private void DeletePerson(object o)
        {
            ListCollectionView lcv = GetIt <ListCollectionView>("PersonListView");

            PersonVM selectedPerson = (PersonVM)lcv.CurrentItem;

            if (selectedPerson == null)
            {
                return;
            }

            lcv.Remove(selectedPerson);
            ShowMessage("Selected Person has been removed!");
        }
        private void AddPerson(object o)
        {
            try
            {
                ListCollectionView lcv = GetIt <ListCollectionView>("PersonListView");

                if (TryGetViewManager("Business", typeof(PersonDAL), out IManageCViews cViewManager))
                {
                    PersonVM newPerson = (PersonVM)cViewManager.GetNewItem();
                    lcv.AddNewItem(newPerson);
                    lcv.MoveCurrentTo(newPerson);
                }
                else
                {
                    System.Diagnostics.Debug.WriteLine($"Could not get the view manager -- Fix this message.");
                }
            }
            catch (Exception ex)
            {
                ShowMessage(ex.Message);
            }
        }
Esempio n. 3
0
 protected PersonVM(PersonVM copySource)
     : base(copySource)
 {
 }