예제 #1
0
    protected void OnOpenIdleWindow(object sender, InteractionEventArgs args)
    {
        IUIViewLocator viewLocator = Context.GetApplicationContext().GetService <IUIViewLocator>();

        //WheelWindow wheelWindow = viewLocator.LoadWindow<WheelWindow>(this.WindowManager, "UI/Wheel");
        //var wheelViewModel = args.Context;
        //wheelWindow.SetDataContext(wheelViewModel);
        //wheelWindow.Create();
        //wheelWindow.Show();

        //CardDrawWindow cardDrawWindow = viewLocator.LoadWindow<CardDrawWindow>(this.WindowManager, "UI/CardDraw");
        //var cardDrawModel = args.Context;
        //cardDrawWindow.SetDataContext(cardDrawModel);
        //cardDrawWindow.Create();
        //cardDrawWindow.Show();

        IdleWindow idleWindow = viewLocator.LoadWindow <IdleWindow>(this.WindowManager, "UI/Idle");

        idleWindow.Create();
        idleWindow.Show();
    }
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            IdleWindow wind = new IdleWindow();

            if (loginBox.Text.Length < 4 || passwordBox.Password.Length <= 8)
            {
                MessageBox.Show("Your login or password is wrong!");
            }
            else
            {
                var response = await Actions.AuthenticateUser(loginBox.Text, passwordBox.Password);

                if (response.StatusCode == HttpStatusCode.OK)
                {
                    wind.Show();
                }
                else
                {
                    MessageBox.Show("Connection filed!");
                }
            }
        }