Example #1
0
        public void DeleteItem(ItemModel item)
        {
            if (item == null)
                return;

            items.Remove(item);
        }
Example #2
0
        public void AddItem(ItemModel item)
        {
            if (item == null)
                return;

            items.Add(item);
        }
        public void DeleteItem(ItemModel item)
        {
            if (item == null)
                return;

            if (items == null)
                LoadDataFromStore();

            items.Remove(item);
            SaveDataToStore();
        }
        public void AddItem(ItemModel item)
        {
            if (item == null)
                return;

            if (items == null)
                LoadDataFromStore();

            items.Add(item);
            SaveDataToStore();
        }
Example #5
0
 private void RegisterForMessages()
 {
     Messenger.Default.Register<NotificationMessage<ItemModel>>(this,
         message =>
         {
             if (message.Notification == Notifications.NotifyItemEdited)
             {
                 _item = message.Content;
                 RaisePropertyChanged(ItemPropertyName);
                 RaisePropertyChanged(NamePropertyName);
                 RaisePropertyChanged(DescriptionPropertyName);
                 RaisePropertyChanged(LastResetPropertyName);
                 RaisePropertyChanged(CreatedPropertyName);
             }
         });
 }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemViewModel"/> class.
 /// </summary>
 /// <param name="_item">The _item model to work with.</param>
 public ItemViewModel(ItemModel item)
     : this()
 {
     this._item = item;
     UpdateTimeSince();
 }