Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ActivityVM"/> class from the model.
        /// </summary>
        /// <param name="entity">The model.</param>
        /// <param name="access"></param>
        /// <param name="dataService"></param>
        public ActivityGroupVM(ActivityGroup entity, AccessType access, ActivityGroupDataService dataService)
            : base(access)
        {
            InitializeData(dataService);
            _model = entity;

            Activitys = new ObservableCollection<Activity>();
            foreach (Activity activity in entity.Activities)
            {
                Activitys.Add(activity);
            }
        }
Esempio n. 2
0
     private void FixupActivityGroup(ActivityGroup previousValue)
     {
         if (previousValue != null && previousValue.Activities.Contains(this))
         {
             previousValue.Activities.Remove(this);
         }
 
         if (ActivityGroup != null)
         {
             if (!ActivityGroup.Activities.Contains(this))
             {
                 ActivityGroup.Activities.Add(this);
             }
         }
     }
Esempio n. 3
0
 public override void Save(object param)
 {
     ActivityGroupDataService.AttachModel(_model);
     _model = ActivityGroupDataService.GetSingle(_model.Id); OnPropertyChanged("ModifiedBy");OnPropertyChanged("ModifiedDate");Mode = ModificationStatus.Saved;
 }