public void Append(SignalMessageContainer sm) { var sourcePanel = (ItemsStackPanel)ConversationItemsControl.ItemsPanelRoot; bool bottom = sourcePanel.LastVisibleIndex == Collection.Count - 2; // -2 because we already incremented Count Collection.Add(sm, sm.Message.Author == null); if (bottom) { UpdateLayout(); ScrollToBottom(); } }
public void Append(SignalMessageContainer sm, bool forceScroll) { var sourcePanel = (ItemsStackPanel)ConversationItemsControl.ItemsPanelRoot; bool bottom = sourcePanel.LastVisibleIndex == Collection.Count - 2; /* -2 because we already incremented Count */ Collection.Add(sm, true); if (forceScroll || bottom) { UpdateLayout(); ScrollToBottom(); } }
public AppendResult Append(IMessageView sm) { AppendResult result = new AppendResult(false); bool bottom = GetBottommostIndex() == Collection.Count - 2; // -2 because we already incremented Count Collection.Add(sm, sm.Model.Author == null); if (bottom) { UpdateLayout(); ScrollToBottom(); if (ActivationState != CoreWindowActivationState.Deactivated) { result = new AppendResult(true); } } return(result); }
public AppendResult Append(SignalMessageContainer sm) { AppendResult result = null; bool bottom = GetBottommostIndex() == Collection.Count - 2; // -2 because we already incremented Count Collection.Add(sm, sm.Message.Author == null); if (bottom) { UpdateLayout(); ScrollToBottom(); if (ActivationState != CoreWindowActivationState.Deactivated) { result = new AppendResult(sm.Index); } } return(result); }