Beispiel #1
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            MainWindow = new AppWindow();
            MainWindow.Show();
        }
        public AppBusiness()
        {
            AppWindowViewModel appWindowViewModel = new AppWindowViewModel(riddles);

            AppWindow appWindow = new AppWindow();

            appWindow.DataContext = appWindowViewModel;
            appWindow.Show();
        }
        public bool OpenWindow(string windowName, object dataContext, object owner, bool topMost = false, bool showInTaskbar = true)
        {
            var win = new AppWindow(windowName, dataContext, SizeToContent.Manual, WindowStartupLocation.CenterOwner)
            {
                Topmost = topMost, ShowInTaskbar = showInTaskbar
            };

            win.Owner         = win.FindOwnerWindow(owner);
            win.AsModalDialog = false;
            Application.Current.Dispatcher.Invoke(() => win.Show());
            _win = win;
            return(true);
        }
    private void BtnSignup_Click(object sender, RoutedEventArgs e)
    {
        var u = new User();

        if (u.Login(con, tbxEmail.Text, tbxPassword.Text))
        {
            AppWindow a = new AppWindow();
            a.Show();
        }
        else
        {
            lblMissingParameter.Content = "Incorrect Password or Email entered";
        }
    }
Beispiel #5
0
        public static void Main(string[] args)
        {
            Application.Init();
            Application app = new Application("dev.simo-andreev.catabase", ApplicationFlags.None);

            app.Register(Cancellable.Current);

            Window window = new AppWindow("CataBase S");

            app.AddWindow(window);

            window.SetIconFromFile("res/images/C-Sharp.png");

            window.Show();
            Application.Run();
        }
Beispiel #6
0
        private async Task SwitchToAppWindow(bool autoLogin)
        {
            if (!Resolve <UserAuth>().LoggedIn)
            {
                return;
            }

            if (Resolve <IAppSettings>().StartMinimized != StartMinimizedMode.Disabled)
            {
                await StartAllServices();
            }

            await Resolve <ISettingsServiceClientManager>().UpdateServiceSettings();

            Resolve <PinFactory>().BuildPins();

            await Resolve <IClientConfig>().Update();
            await Resolve <StreamingServicesUpdater>().Update();

            LoadViewModels();
            Resolve <P2PDetector>();
            Resolve <VpnInfoChecker>();

            AppWindow appWindow = Resolve <AppWindow>();

            appWindow.DataContext          = Resolve <MainViewModel>();
            Application.Current.MainWindow = appWindow;
            if (Resolve <IAppSettings>().StartMinimized != StartMinimizedMode.ToSystray)
            {
                appWindow.Show();
            }

            Resolve <LoginWindow>().Hide();

            Resolve <PlanDowngradeHandler>();
            await Resolve <Trial.Trial>().Load();
            await Resolve <IUserLocationService>().Update();
            await Resolve <IAnnouncements>().Update();
            await Resolve <AutoConnect>().Load(autoLogin);

            Resolve <SyncProfiles>().Sync();
            Resolve <INetworkClient>().CheckForInsecureWiFi();
            await Resolve <EventClient>().StoreLatestEvent();

            Resolve <EventTimer>().Start();
        }
        private void LoginOperation()
        {
            UserDomain userDomain = new UserDomain(1, Common.Enums.LanguagesEnum.Arabic);
            User userEntity = new User();
            userEntity = userDomain.CheckUserLogin(txt_Username.Text, txt_Password.Password);
            if (userDomain.ActionState.Status != Common.Enums.ActionStatusEnum.NoError)
            {
                SetError(0, userDomain.ActionState.Result);
            }
            else
            {
                UISecurity.UserEntity = userEntity;
                AppWindow appWindow = new AppWindow();

                appWindow.Show();
                ((Window)((Grid)this.Parent).Parent).Close();

            }
        }
Beispiel #8
0
        private void LoginAction(object obj)
        {
            /*var password = (obj as PasswordBox)?.Password;
             * if (LoginForm.Validate())
             * {
             *  //Отправить на сервер запрос
             * }
             * else
             * {
             *  MessageBox.Show("Wrong mail or password");
             * }*/
            AppWindow appWindow = new AppWindow();

            foreach (Window window in App.Current.Windows)
            {
                if (window.Title == "AuthorizationWindow")
                {
                    window.Close();
                }
            }
            appWindow.Show();
        }