コード例 #1
0
        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();
            }
        }
コード例 #2
0
        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();
            }
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        protected override DataTemplate SelectTemplateCore(object item, DependencyObject container)
        {
            FrameworkElement element = container as FrameworkElement;

            if (item is SignalMessageContainer)
            {
                SignalMessageContainer smc = (SignalMessageContainer)item;
                SignalMessage          sm  = smc.Message;
                if (sm.Type == SignalMessageType.IdentityKeyChange)
                {
                    return(IdentityKeyChangeMessage);
                }
                return(NormalMessage);
            }
            if (item is SignalUnreadMarker)
            {
                return(UnreadMarker);
            }
            return(null);
        }
コード例 #5
0
 public void AddToOutgoingMessagesCache(SignalMessageContainer m)
 {
     OutgoingCache[m.Message.Id] = m;
 }