Exemplo n.º 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button thisbtn = (Button)e.Source;

            int index = int.Parse(thisbtn.Uid);

            if (index == 1)
            {
                ActualizarUsuario();
                return;
            }

            if (index == 3)
            {
                AbrirManual();
                return;
            }

            var  par   = VisualTreeHelper.GetParent((Button)e.Source) as UIElement;
            Grid PGrid = (par as Grid);

            var  ParBoord  = VisualTreeHelper.GetParent(SelectedBord);
            Grid LastPGrid = ParBoord as Grid;

            LastPGrid.Children.Remove(SelectedBord);

            PGrid.Children.Add(SelectedBord);

            switch (index)
            {
            case 0:
                UsuarioDG frm0 = new UsuarioDG();
                ContentFrame.Content = frm0;
                break;

            case 1:
                break;

            case 2:
                ServiciosFrm frm1 = new ServiciosFrm();
                ContentFrame.Content = frm1;
                break;

            case 3:
                break;

            case 4:
                break;
            }
        }
Exemplo n.º 2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            int index = int.Parse(((Button)e.Source).Uid);

            if (index == LastIndex)
            {
                return;
            }

            var    par   = VisualTreeHelper.GetParent((Button)e.Source) as UIElement;
            Border PBord = (par as Border);

            PBord.BorderThickness = new Thickness(0, 0, 0, 5);

            if (LastIndex > -1)
            {
                LastSelected.BorderThickness = new Thickness(0, 0, 0, 0);
            }

            LastIndex    = index;
            LastSelected = PBord;

            switch (index)
            {
            case 0:
                GestionMenu frm2 = new GestionMenu();
                ContentFrame.Content = frm2;

                break;

            case 1:
                ActividadMenu frm1 = new ActividadMenu();
                ContentFrame.Content = frm1;
                break;

            case 2:
                AdministracionMenu frm = new AdministracionMenu();
                ContentFrame.Content = frm;
                break;

            case 3:
                UsuarioDG DG = new UsuarioDG();
                ContentFrame.Content = DG;
                break;

            case 4:
                break;
            }
        }