Esempio n. 1
0
        private void EditAdresButton_Click(object sender, RoutedEventArgs e)
        {
            if (AdressesListBox.SelectedItem == null)
            {
                return;
            }

            if (AdministrationClass.AllowAnnimations)
            {
                var opacityAnnimation = new DoubleAnimation(0, new Duration(new TimeSpan(0, 0, 0, 0, 150)));
                opacityAnnimation.Completed += (s, args) =>
                {
                    EditProcedure();

                    opacityAnnimation = new DoubleAnimation(1, new Duration(new TimeSpan(0, 0, 0, 0, 150)));
                    AdressesOpacityGrid.BeginAnimation(Control.OpacityProperty, opacityAnnimation);
                };

                AdressesOpacityGrid.BeginAnimation(Control.OpacityProperty, opacityAnnimation);
            }
            else
            {
                EditProcedure();
            }
            AdressesListBox.IsEnabled = false;
        }
Esempio n. 2
0
        private void CancelAdressButton_Click(object sender, RoutedEventArgs e)
        {
            if (AdministrationClass.AllowAnnimations)
            {
                var opacityAnnimation = new DoubleAnimation(0, new Duration(new TimeSpan(0, 0, 0, 0, 150)));
                opacityAnnimation.Completed += (s, args) =>
                {
                    CancelProcedure();

                    opacityAnnimation = new DoubleAnimation(1, new Duration(new TimeSpan(0, 0, 0, 0, 150)));
                    AdressesOpacityGrid.BeginAnimation(Control.OpacityProperty, opacityAnnimation);
                };

                AdressesOpacityGrid.BeginAnimation(Control.OpacityProperty, opacityAnnimation);
            }
            else
            {
                CancelProcedure();
            }
        }