Exemplo n.º 1
0
        private void ChangePage(object sender, RoutedEventArgs e)
        {
            string tagUid = String.Empty;

            if (e.Source is ImageAwesome awesome)
            {
                tagUid = awesome.Tag.ToString();
            }
            else if (e.Source is TextBlock block)
            {
                tagUid = block.Tag.ToString();
            }

            switch (tagUid)
            {
            case "PageProfil":
                ContentArea.Content = new Profil.Profil();
                break;

            case "PageAccueil":

                break;

            case "PageMessagerie":
                ContentArea.Content = new MessagerieHome();
                break;

            case "PageAide":
                ContentArea.Content = new Aide();
                break;

            case "PageDocumentation":
                ContentArea.Content = new Communaute.Documentation.Doc();
                break;

            case "PageCode":
                ContentArea.Content = new ExtraitCodeHome();
                break;

            case "PageIdees":

                break;

            case "PageIDEs":

                break;

            case "PageRecherche":

                break;

            case "PageFavoris":

                break;

            case "PageAdministration":
                List <int> idRoles = UserConnected.GetUserConnected().GetIdRoles();
                if (idRoles.Contains(5) || idRoles.Contains(4) || idRoles.Contains(3) || idRoles.Contains(2) || idRoles.Contains(1))
                {
                    if (UserConnected.VerifyHabilitations())
                    {
                        ContentArea.Content = new Administration.Administration();
                    }
                    else
                    {
                        MessageHabilitation.MessageNoHabilitate();
                    }
                }
                else
                {
                    MessageHabilitation.MessageNoHabilitate();
                }
                break;

            case "PageParametres":

                break;
            }
        }