Exemplo n.º 1
0
 public vmMenu()
 {
     GlobalNavigation.Reiniciar();
     ns = GlobalNavigation.NavService;
     GlobalNavigation.Modulo = "DESENVOLVIMENTO";
     GetAcesso();
 }
Exemplo n.º 2
0
 public vmMainContent()
 {
     GlobalNavigation.Reiniciar();
     ns = GlobalNavigation.NavService;
     GlobalNavigation.Modulo = "GOVERNO";
     GetAcesso();
 }
Exemplo n.º 3
0
 public vmModulos()
 {
     GlobalNavigation.Reiniciar();
     ns = GlobalNavigation.NavService;
     ns.RemoveBackEntry();
     HasUpdate = false;
     GetAcesso();
 }
Exemplo n.º 4
0
        /// <summary>
        /// Inicio
        /// </summary>
        public vmSelectModules()
        {
            GlobalNavigation.Reiniciar();
            ns = GlobalNavigation.NavService;
            ns.RemoveBackEntry();

            Task.Factory.StartNew(() => CreatButtons()).ContinueWith(task =>
            {
                if (task.IsCompleted)
                {
                    ButtonsModules = task.Result;
                    //SysModules = task.Result;
                }
            });
        }
Exemplo n.º 5
0
        /// <summary>
        /// Observa Propriedades Globais
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnGlobalPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Autenticado")
            {
                if (Logged.Autenticado == false)
                {
                    GlobalNavigation.Reiniciar();
                    MenuOn    = Visibility.Collapsed;
                    IsAdmin   = Visibility.Collapsed;
                    MenuOnOff = Visibility.Collapsed;
                    //Application.Current.Resources["WindowBackgroundColor"] = Color.FromRgb(0x1b, 0xa1, 0xe2);
                    if (mStarted.SimStarted)
                    {
                        ns.Navigate(new Uri(Properties.Resources.Sim_View_Load, UriKind.Relative));
                    }
                    else
                    {
                        ns.Navigate(new Uri(Account.Properties.Resources.Account_Login_User, UriKind.Relative));
                        WindowChomeButtonsVisible = Visibility.Visible;
                        StartClosed = Visibility.Collapsed;
                    }

                    Color paleta = new Color();
                    //paleta = (Color)ColorConverter.ConvertFromString("##00FFFF");
                    paleta = Color.FromRgb(0x1b, 0xa1, 0xe2);
                    new UI.Presentation.ThemeManager().ApplyTheme(paleta, "Light");
                }

                else
                {
                    Color paleta = new Color();
                    paleta = (Color)ColorConverter.ConvertFromString(Logged.Color);
                    new UI.Presentation.ThemeManager().ApplyTheme(paleta, Logged.Thema);
                    MenuOn = Visibility.Visible;

                    Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Background, new System.Action(delegate
                    {
                        ns.Navigate(new Uri(Properties.Resources.Sim_View_Root, UriKind.Relative));
                    }));
                    if (Logged.Acesso >= (int)AccountAccess.Administrador)
                    {
                        IsAdmin = Visibility.Visible;
                    }
                }

                if (Logged.Sexo == "F")
                {
                    IconUser = UserIcon.Woman;
                }

                if (Logged.Sexo == "M")
                {
                    IconUser = UserIcon.Man;
                }

                Operador = Logged.Nome;
            }

            if (e.PropertyName == "Modulo")
            {
                Modulo = GlobalNavigation.Modulo;
            }

            if (e.PropertyName == "UriModulo")
            {
                UriModulo = GlobalNavigation.UriModulo;
            }

            if (e.PropertyName == "UriSubModulo")
            {
                UriSubModulo = GlobalNavigation.UriSubModulo;
            }

            if (e.PropertyName == "SubModulo")
            {
                SubModulo = GlobalNavigation.SubModulo;
            }


            if (e.PropertyName == "Pagina")
            {
                Pagina = GlobalNavigation.Pagina;
            }

            if (e.PropertyName == "BrowseBack")
            {
                BrowseBack = GlobalNavigation.BrowseBack;
            }
        }
Exemplo n.º 6
0
        /// <summary>
        /// Observa Propriedades Globais
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnGlobalPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Autenticado")
            {
                if (AccountOn.Autenticado == false)
                {
                    GlobalNavigation.Reiniciar();
                    MenuOn    = Visibility.Collapsed;
                    IsAdmin   = Visibility.Collapsed;
                    MenuOnOff = Visibility.Collapsed;
                    vW        = 20;
                    ns.Navigate(new Uri("/Sim.Modulo.Autenticacao;component/View/vLogin.xaml", UriKind.Relative));
                    Color paleta = new Color();
                    //paleta = (Color)ColorConverter.ConvertFromString("##00FFFF");
                    paleta = Color.FromRgb(0x1b, 0xa1, 0xe2);
                    new ModernUI.Presentation.ThemeManager().Apply(paleta, "Light");
                }

                else
                {
                    Color paleta = new Color();
                    paleta = (Color)ColorConverter.ConvertFromString(AccountOn.Color);
                    new ModernUI.Presentation.ThemeManager().Apply(paleta, AccountOn.Thema);
                    MenuOn = Visibility.Visible;
                    ns.Navigate(new Uri("/Sim.App.Desktop;component/View/pModulos.xaml", UriKind.Relative));
                    if (AccountOn.Acesso >= (int)AccountAccess.Administrador)
                    {
                        IsAdmin = Visibility.Visible;
                    }
                }

                if (AccountOn.Sexo == "F")
                {
                    IconUser = mIcons.IcoWom;
                }

                if (AccountOn.Sexo == "M")
                {
                    IconUser = mIcons.IcoMan;
                }

                Operador = AccountOn.Nome;
            }

            if (e.PropertyName == "Modulo")
            {
                Modulo = GlobalNavigation.Modulo;
            }

            if (e.PropertyName == "UriModulo")
            {
                UriModulo = GlobalNavigation.UriModulo;
            }

            if (e.PropertyName == "UriSubModulo")
            {
                UriSubModulo = GlobalNavigation.UriSubModulo;
            }

            if (e.PropertyName == "SubModulo")
            {
                SubModulo = GlobalNavigation.SubModulo;
            }


            if (e.PropertyName == "Pagina")
            {
                Pagina = GlobalNavigation.Pagina;
            }

            if (e.PropertyName == "BrowseBack")
            {
                BrowseBack = GlobalNavigation.BrowseBack;
            }
        }