private void Action_Click(object sender, EventArgs e)
        {
            ChatProductCardDataItem dataItem           = this.DataItem as ChatProductCardDataItem;
            LightVisualElement      lightVisualElement = sender as LightVisualElement;

            foreach (ChatCardAction action in dataItem.Actions)
            {
                if (action.Text == lightVisualElement.Text)
                {
                    this.OnCardActionClicked(new CardActionEventArgs(action, this.DataItem.UserData));
                }
            }
        }
        protected override void Synchronise()
        {
            base.Synchronise();
            ChatProductCardDataItem dataItem = this.DataItem as ChatProductCardDataItem;

            this.ImageElement.Image   = dataItem.Image;
            this.TitleElement.Text    = dataItem.Title;
            this.RatingElement.Text   = dataItem.Rating;
            this.SubtitleElement.Text = dataItem.Subtitle;
            this.PriceElement.Text    = dataItem.Price;
            while (this.StackElement.Children.Count > 5)
            {
                this.StackElement.Children.RemoveAt(5);
            }
            if (dataItem.Actions == null)
            {
                return;
            }
            foreach (ChatCardAction action in dataItem.Actions)
            {
                LightVisualElement lightVisualElement = new LightVisualElement();
                lightVisualElement.Text                 = action.Text;
                lightVisualElement.Padding              = new Padding(0, 8, 0, 8);
                lightVisualElement.TextAlignment        = ContentAlignment.MiddleCenter;
                lightVisualElement.BorderBoxStyle       = BorderBoxStyle.FourBorders;
                lightVisualElement.BorderTopColor       = Color.Gray;
                lightVisualElement.BorderTopShadowColor = Color.Gray;
                lightVisualElement.BorderTopWidth       = 2f;
                lightVisualElement.BorderLeftWidth      = 0.0f;
                lightVisualElement.BorderRightWidth     = 0.0f;
                lightVisualElement.BorderBottomWidth    = 0.0f;
                lightVisualElement.DrawBorder           = true;
                lightVisualElement.SmoothingMode        = SmoothingMode.AntiAlias;
                lightVisualElement.Click               += new EventHandler(this.Action_Click);
                this.StackElement.Children.Add((RadElement)lightVisualElement);
            }
        }
 public ChatProductCardElement(ChatProductCardDataItem item)
     : base((BaseChatCardDataItem)item)
 {
 }