public void DeleteItem(ItemModel item) { if (item == null) return; items.Remove(item); }
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(); }
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); } }); }
/// <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(); }