コード例 #1
0
ファイル: LoginView.cs プロジェクト: wuguanyang/QFramework
        public LoginView()
        {
            var usernameLine = new HorizontalLayout().AddTo(this);

            new LabelView("username:"******"").AddTo(usernameLine);

            var passwordLine = new HorizontalLayout().AddTo(this);

            new LabelView("password:"******"").PasswordMode().AddTo(passwordLine);

            var loginBtn    = new ButtonView("登录").AddTo(this);
            var registerBtn = new ButtonView("注册").AddTo(this);

            loginBtn.OnClick.AddListener(() =>
            {
                PackageKitLoginApp.Send(new LoginCommand(username.Content.Value, password.Content.Value));
            });

            registerBtn.OnClick.AddListener(() =>
            {
                PackageKitLoginApp.Send <OpenRegisterWebsiteCommand>();
            });
        }
コード例 #2
0
        public RegisterView()
        {
            var usernameLine = new HorizontalLayout().AddTo(this);

            new LabelView("username:"******"").AddTo(usernameLine);

            var passwordLine = new HorizontalLayout().AddTo(this);

            new LabelView("password:"******"").PasswordMode().AddTo(passwordLine);

            new ButtonView("注册", () => { }).AddTo(this);

            new ButtonView("返回注册", () => { PackageKitLoginApp.Send(new OpenRegisterViewCommand()); })
            .AddTo(this);
        }