protected void ChangeItemState(object param, CommunicationItemState state, bool isEditing) { if (param is CommunicationItemViewModel) { // if old state is Appended we have no to change it if ((param as CommunicationItemViewModel).State == CommunicationItemState.Appended) { //if old state is Appended and new state Deleted then delete item if (state == CommunicationItemState.Deleted) { Items.Remove((param as CommunicationItemViewModel)); } } else { (param as CommunicationItemViewModel).State = state; } (param as CommunicationItemViewModel).IsEditing = isEditing; (param as CommunicationItemViewModel).RaiseCanExecuteChanged(); if (state == CommunicationItemState.Deleted) { RefreshItems(); } if (isEditing) { ItemsCollection.MoveCurrentTo(param as CommunicationItemViewModel); } OnPropertyChanged("OneItemInCommunicationIsInEditState"); } }
public MockCommunicationItemsBuilder WithNotes(int count, CommunicationItemState state) { for (int i = 0; i < count; i++) { _mock.Add(MockCommunicationItemNoteBuilder.Build().WithState(state).GetMock()); } return(this); }
public MockCommunicationItemBuilder WithState(CommunicationItemState state) { _mock.State = state; return this; }
public MockCommunicationItemsBuilder WithNotes(int count, CommunicationItemState state) { for (int i = 0; i < count; i++) { _mock.Add(MockCommunicationItemNoteBuilder.Build().WithState(state).GetMock()); } return this; }
public List<CommunicationItemViewModel> GetItemsByState(CommunicationItemState state) { return (Items != null) ? Items.Where((x) => x.State == state).ToList() : new List<CommunicationItemViewModel>(); }
protected void ChangeItemState(object param, CommunicationItemState state, bool isEditing) { if (param is CommunicationItemViewModel) { // if old state is Appended we have no to change it if ((param as CommunicationItemViewModel).State == CommunicationItemState.Appended) { //if old state is Appended and new state Deleted then delete item if (state == CommunicationItemState.Deleted) { Items.Remove((param as CommunicationItemViewModel)); } } else { (param as CommunicationItemViewModel).State = state; } (param as CommunicationItemViewModel).IsEditing = isEditing; (param as CommunicationItemViewModel).RaiseCanExecuteChanged(); if (state == CommunicationItemState.Deleted) { RefreshItems(); } if (isEditing) { ItemsCollection.MoveCurrentTo(param as CommunicationItemViewModel); } OnPropertyChanged("OneItemInCommunicationIsInEditState"); } }
public List <CommunicationItemViewModel> GetItemsByState(CommunicationItemState state) { return((Items != null) ? Items.Where((x) => x.State == state).ToList() : new List <CommunicationItemViewModel>()); }
public List<CommunicationAttachment> GetAttacmentsByState(CommunicationItemState state) { return Attachments != null ? Attachments.Where(x => x.State == state).ToList() : new List<CommunicationAttachment>(); }
public MockCommunicationItemBuilder WithState(CommunicationItemState state) { _mock.State = state; return(this); }
public List <CommunicationAttachment> GetAttacmentsByState(CommunicationItemState state) { return(Attachments != null?Attachments.Where(x => x.State == state).ToList() : new List <CommunicationAttachment>()); }