Exemplo n.º 1
0
        protected void AppendCommunicationItem(CommunicationItemViewModel item, bool isNew, bool isEditing)
        {
            if (item != null)
            {
                if (isNew)
                {
                    item.State        = CommunicationItemState.Appended;
                    item.IsEditing    = isEditing;
                    item.AuthorId     = _authorId;
                    item.AuthorName   = _authorName;
                    item.LastModified = DateTime.Now.ToUniversalTime();
                }

                DefItemCommands(item);
                item.RaiseCanExecuteChanged();

                Items.Add(item);


                if (isNew && ItemsCollection != null)
                {
                    RefreshItems();
                    ItemsCollection.MoveCurrentToFirst();
                }
                item.CommunicationItemPropertyChanged += CommunicationItem_OnPropertyChanged;

                OnPropertyChanged("OneItemInCommunicationIsInEditState");
                OnPropertyChanged("Items");
                OnPropertyChanged("IsShowEmpty");

                ModifiedRequest();
            }
        }