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>(); }); }
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); }