public void SendStickerOnTheLeft(MessageCore.Sticker.Sticker stickerInfo, bool reversed = false, BubbleChat previous = null, BubbleChat head = null) { try { Resources.CustomControls.Sticker sticker = new Resources.CustomControls.Sticker(this, false, stickerInfo.ID, stickerInfo.CategoryID, 130, stickerInfo.Duration, stickerInfo.SpriteURL, true); Thickness margin = sticker.Margin; margin.Left = 30; margin.Top = 10; margin.Bottom = 10; sticker.HorizontalAlignment = HorizontalAlignment.Left; sticker.Margin = margin; if (reversed) { head.InsertSticker(sticker); } else { previous.AddSticker(sticker); } // spMessagesContainer.Children.Add(sticker); MessagesContainer.ScrollToEnd(); } catch (Exception e) { throw new Exception("Sticker ex: ", e); } }
public void SendStickerOnTheRight(MessageCore.Sticker.Sticker stickerInfo, bool reversed = false) { try { Resources.CustomControls.Sticker sticker = new Resources.CustomControls.Sticker(this, false, stickerInfo.ID, stickerInfo.CategoryID, 130, stickerInfo.Duration, stickerInfo.SpriteURL, true); Thickness margin = sticker.Margin; margin.Right = 30; margin.Top = 10; margin.Bottom = 10; sticker.HorizontalAlignment = HorizontalAlignment.Right; sticker.Margin = margin; if (reversed) { spMessagesContainer.Children.Insert(0, sticker); } else { spMessagesContainer.Children.Add(sticker); } MessagesContainer.ScrollToEnd(); } catch (Exception e) { throw new Exception("Sticker ex: ", e); } }