private void AnimateNotifications(object sender, TappedRoutedEventArgs e) { //Grid parentGrid = (sender as FrameworkElement).Parent as Grid; double actualHeight = NotificationsGrid.ActualHeight; if (AddCostViewModel.IsNotificationShown == false) { if (AddCostViewModel.IsNotificationRaised) { AnimateRotationCW.Begin(); } else { AnimateRotation.Begin(); } AddCostViewModel.IsNotificationShown = true; AddCostViewModel.NotificationsBlockTranslation(actualHeight); } else { AnimateRotationCCW.Begin(); AddCostViewModel.IsNotificationShown = false; AddCostViewModel.NotificationsBlockTranslation(actualHeight); } }
public AddCost() { double temporaryPageWidth = this.ActualWidth; previousWidth = temporaryPageWidth; AddCostViewModel.UpdateKeyboardButtonSize((int)Math.Floor(temporaryPageWidth)); this.InitializeComponent(); this.SizeChanged += AddCost_SizeChanged; this.NotificationsButton.Tapped += AnimateNotifications; AddCostViewModel.Translated += (s, e) => { AnimateBlockTranslation.Begin(); }; AddCostViewModel.Sized += (s, e) => { AnimateSizeTranslation.Begin(); }; AddCostViewModel.FormEnebled += (s, e) => { if (AddCostViewModel.IsFormEnebled) { AnimateFormEnebled.Begin(); } else { AnimateFormDisabled.Begin(); } }; AddCostViewModel.NotificationRaised += (s, e) => { if (AddCostViewModel.IsNotificationRaised) { AnimateNotificationRaised.Begin(); } else { AnimateNotificationCleared.Begin(); AnimateRotationCCW.Begin(); } }; }