예제 #1
0
        private void Inf_Click(object sender, RoutedEventArgs e)
        {
            s_f = false;
            double parsedtvalue;

            if (double.TryParse(Valeur.Text, out parsedtvalue))
            {
                montant = parsedtvalue;

                second_page_grid.Visibility = Visibility.Hidden;
                grid_stat_principale.Children.Clear();
                PointLabel = chartPoint =>
                             string.Format("{0} ({1:P})", chartPoint.Y, chartPoint.Participation);

                chargement_Piechart();
                chargement_tresor();
                chargement_nombre_prêt();

                //SeriesCollection[3].Values.Add(5d);
                DataContext = this;

                grid_stat_principale.Children.Add(second_page_grid);
                grid_stat_principale.Children.Add(first_page_statistiques);
                grid_stat_principale.Children.Add(Année);
                grid_stat_principale.Children.Add(submit_year);

                Année.Visibility                   = Visibility.Hidden;
                submit_year.Visibility             = Visibility.Hidden;
                first_page_statistiques.Visibility = Visibility.Hidden;
                second_page_grid.Visibility        = Visibility.Visible;

                /*
                 * montant = 7000;
                 * pie.IsManipulationEnabled = true;
                 *
                 * responsable.stat_type_pret(montant, year);
                 * this.pie.Series[0].Values[0] = responsable.list_inf[1] ;
                 * this.pie.Series[1].Values[0] = responsable.list_inf[2];
                 * this.pie.Series[2].Values[0] = responsable.list_inf[3];
                 *
                 * this.pie.Update(true, true);
                 *
                 */
            }
            else
            {
                Erreur.Visibility = Visibility.Visible;
                DoubleAnimation a = new DoubleAnimation();
                a.From     = 1.0; a.To = 0.0;
                a.Duration = new Duration(TimeSpan.FromSeconds(5));
                Erreur.BeginAnimation(OpacityProperty, a);
            }
        }