Ejemplo n.º 1
0
        private async void LikeButton_Hold(object sender, bool e)
        {
            if (e)
            {
                if (App.BiliViewModel.CheckAccoutStatus())
                {
                    bool result = await _videoService.TripleVideoAsync(_detail.aid);

                    if (result)
                    {
                        LikeButton.IsCheck     = true;
                        CoinButton.IsCheck     = true;
                        FavoriteButton.IsCheck = true;
                        CoinButton.ShowBubble();
                        FavoriteButton.ShowBubble();
                        new TipPopup("已一键三连~").ShowMessage();
                        UpdateVideoInfo();
                    }
                    else
                    {
                        new TipPopup("一键三连失败QAQ").ShowError();
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private void PrepareCoinDrawer()
        {
            CoinButton btn5ch = new CoinButton(5m)
            {
                Width   = 100,
                Height  = 100,
                Visible = true
            };

            btn5ch.Text = "5 CHF";

            CoinButton btn2ch = new CoinButton(2m)
            {
                Width   = 87,
                Height  = 87,
                Visible = true
            };

            btn2ch.Text = "2 CHF";

            CoinButton btn1ch = new CoinButton(1m)
            {
                Width   = 74,
                Height  = 74,
                Visible = true
            };

            btn1ch.Text = "1 CHF";

            CoinButton btn50Cch = new CoinButton(0.5m)
            {
                Width   = 58,
                Height  = 58,
                Visible = true
            };

            btn50Cch.Text = "1/2 CHF";

            CoinButton btn20Cch = new CoinButton(0.20m)
            {
                Width   = 67,
                Height  = 67,
                Visible = true
            };

            btn20Cch.Text = "20c CHF";

            CoinButton btn10Cch = new CoinButton(0.10m)
            {
                Width   = 61,
                Height  = 61,
                Visible = true
            };

            btn10Cch.Text = "10c CHF";

            CoinButton btn5Cch = new CoinButton(0.05m)
            {
                Width     = 55,
                Height    = 55,
                Visible   = true,
                BackColor = Color.Gold
            };

            btn5Cch.Text = "5c CHF";

            btn5ch.Anchor   = AnchorStyles.Bottom;
            btn2ch.Anchor   = AnchorStyles.Bottom;
            btn1ch.Anchor   = AnchorStyles.Bottom;
            btn50Cch.Anchor = AnchorStyles.Bottom;
            btn20Cch.Anchor = AnchorStyles.Bottom;
            btn10Cch.Anchor = AnchorStyles.Bottom;
            btn5Cch.Anchor  = AnchorStyles.Bottom;

            //register to notify subscriber when click
            btn5ch.Click   += Publish;
            btn2ch.Click   += Publish;
            btn1ch.Click   += Publish;
            btn50Cch.Click += Publish;
            btn20Cch.Click += Publish;
            btn10Cch.Click += Publish;
            btn5Cch.Click  += Publish;

            flowLayoutPanel1.Controls.Add(btn5ch);
            flowLayoutPanel1.Controls.Add(btn2ch);
            flowLayoutPanel1.Controls.Add(btn1ch);
            flowLayoutPanel1.Controls.Add(btn50Cch);
            flowLayoutPanel1.Controls.Add(btn20Cch);
            flowLayoutPanel1.Controls.Add(btn10Cch);
            flowLayoutPanel1.Controls.Add(btn5Cch);
        }