Exemple #1
0
        private void AddNew()
        {
            CurationEvent model = new CurationEvent();

            model.CurationEventID = -1;
            model.MaterialID      = MaterialID;
            model.EventType       = "<New event>";

            var viewModel = new CurationEventViewModel(model);

            _model.Add(viewModel);

            lstEvents.SelectedItem = viewModel;

            RegisterPendingChange(new InsertCurationEventCommand(model));
        }
Exemple #2
0
        protected void LoadEvents()
        {
            detailsGrid.IsEnabled = false;

            var service = new MaterialService(User);
            var list    = service.GetCurationEvents(MaterialID);

            _model = new ObservableCollection <CurationEventViewModel>(list.ConvertAll((model) => {
                var viewModel          = new CurationEventViewModel(model);
                viewModel.DataChanged += new DataChangedHandler(viewModel_DataChanged);
                return(viewModel);
            }));

            lstEvents.ItemsSource = _model;

            if (_model.Count > 0)
            {
                lstEvents.SelectedItem = _model[0];
            }
            _populated = true;
        }