internal async Task Expand() { // setup for animation this.Opacity = 1; ProductPopoverGrid.Opacity = 0; AddToCartButton.ScaleX = 0; BackgroundPanel.TranslationY = BackgroundPanel.Height; // animate up the white background _ = BackgroundPanel.TranslateTo(0, 0, 200); // animate in the Details await ProductPopoverGrid.FadeTo(1, 1000); // animate the button Animation animation = new Animation(); animation.Add(0, 1, new Animation(t => AddToCartButton.ScaleX = t, 0, 1, Easing.SpringOut)); animation.Commit(this, "ButtonAnimation", 16, 500); }
internal async Task Expand() { //[動畫]初始設定 this.Opacity = 1; ProductPopoverGrid.Opacity = 0; btnAddToCart.ScaleX = 0; //[動畫]讓整個BoxView長出來 BackgroundPannel.TranslationY = BackgroundPannel.Height; _ = BackgroundPannel.TranslateTo(0, 0, 200); //[動畫]所有 Detail 依序顯示 _ = ProductPopoverGrid.FadeTo(1, 300); //[動畫]Button Animation animation = new Animation(); animation.Add(0, 1, new Animation(t => btnAddToCart.ScaleX = t, 0, 1, Easing.SpringOut)); animation.Commit(this, "ButtonAnimation", 16, 800); //設定金額 quantityCount = 1; UpdateDisplay(); }