/// <summary>
        /// Instancie la vue précédente et ferme la vue courante
        /// </summary>
        private async void AfficherPagePrecedente()
        {
            var window = Application.Current.Windows.OfType <MetroWindow>().LastOrDefault();

            if (window != null)
            {
                if (!AddFromProjet)
                {
                    var result = await window.ShowMessageAsync("Avertissement", "Voulez-vous vraiment fermer l'édition de client ?", MessageDialogStyle.AffirmativeAndNegative, new MetroDialogSettings
                    {
                        AffirmativeButtonText = "Oui",
                        NegativeButtonText    = "Non",
                        AnimateHide           = false,
                        AnimateShow           = true
                    });

                    if (result == MessageDialogResult.Affirmative)
                    {
                        VueClientList vcl = new VueClientList();
                        ((VueModeleClientList)vcl.DataContext).VuePrecedente      = window;
                        ((VueModeleClientList)vcl.DataContext).CommercialConnecte = CommercialConnecte;
                        vcl.Show();
                        window.Close();
                    }
                }
                else
                {
                    window.Close();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Ferme la fenêtre courante et affiche la vue d'administration client
        /// </summary>
        private void AClient()
        {
            var           window = Application.Current.Windows.OfType <MetroWindow>().FirstOrDefault();
            VueClientList vcl    = new VueClientList();

            ((VueModeleClientList)vcl.DataContext).CommercialConnecte = CommercialConnecte;
            ((VueModeleClientList)vcl.DataContext).VuePrecedente      = window;
            vcl.Show();
            window.Close();
        }