示例#1
0
        public Gift(GiftCacheManager.GiftCache giftCache)
        {
            InitializeComponent();

            SenderBox.Text = giftCache.Username;
            ActionBox.Text = giftCache.Action;
            GiftBox.Text   = giftCache.GiftName;
            if (giftCache.CoinType == "gold")
            {
                // "gold"
                GiftBox.Foreground = GoldBrush;
            }
            else
            {
                // "silver"
                GiftBox.Foreground = SilverBrush;
            }
            Number = giftCache.Number;

            UserId = giftCache.UserId;

            FaceImage.Source = null;
            //FaceImage.Source = FaceLoader.LoadFace(gift.Sender.Id, gift.FaceUri);
            FaceLoader.LoadFaceWithKnownUri(this, giftCache.FaceUri);

            giftCache.Updated += GiftCache_GiftUpdated;
        }
示例#2
0
        public SuperChat(BiliLiveJsonParser.SuperChat superChat)
        {
            InitializeComponent();

            SenderBox.Text  = superChat.User.Name;
            PriceBox.Text   = superChat.Price.ToString();
            MessageBox.Text = superChat.Message;

            if (superChat.TransMark)
            {
                MessageTransBox.Text = superChat.MessageTrans;
            }
            else
            {
                MessageTransBorder.Visibility = Visibility.Collapsed;
            }

            InfoGrid.Background          = new SolidColorBrush(superChat.PriceColor);
            MessageStackPanel.Background = new SolidColorBrush(superChat.BottomColor);

            UserId = superChat.User.Id;

            FaceImage.Source = null;
            //FaceImage.Source = FaceLoader.LoadFace(superChat.User.Id, superChat.Face);
            FaceLoader.LoadFaceWithKnownUri(this, superChat.Face);
        }
示例#3
0
        public Gift(BiliLiveJsonParser.Gift gift)
        {
            InitializeComponent();

            SenderBox.Text = gift.Sender.Name;
            ActionBox.Text = gift.Action;
            GiftBox.Text   = gift.GiftName;
            if (gift.CoinType == "gold")
            {
                // "gold"
                GiftBox.Foreground = GoldBrush;
            }
            else
            {
                // "silver"
                GiftBox.Foreground = SilverBrush;
            }
            Number = gift.Number;

            UserId = gift.Sender.Id;

            FaceImage.Source = null;
            //FaceImage.Source = FaceLoader.LoadFace(gift.Sender.Id, gift.FaceUri);
            FaceLoader.LoadFaceWithKnownUri(this, gift.FaceUri);
        }