Ejemplo n.º 1
0
        public Login()
        {
            var table = new Table ();
            var image = new ImageView {
                Image = Icons.UserInfo.WithBoxSize (96),
            };
            userEntry = new TextEntry {
                PlaceholderText = Catalog.GetString ("User"),
            };
            passwordEntry = new PasswordEntry {
                PlaceholderText = Catalog.GetString ("Password"),
            };
            var userLabel = new Label {
                Text = Catalog.GetString ("User"),
                TextAlignment = Alignment.Center,
            };
            var passwordLabel = new Label {
                Text = Catalog.GetString ("Password"),
                TextAlignment = Alignment.Center,
            };
            info = new Label {
                TextAlignment = Alignment.Center,
                TextColor = new Color (1, 0, 0),
                Visible = false,
            };
            userEntry.Activated += delegate {
                passwordEntry.SetFocus ();
            };
            passwordEntry.Activated += OnAutenticate;

            table.Add (image, 0, 0, 4);
            table.Add (userLabel, 1, 0);
            table.Add (userEntry, 1, 1);
            table.Add (passwordLabel, 1, 2);
            table.Add (passwordEntry, 1, 3);
            table.Add (info, 0, 4, colspan: 2);

            Content = table;

            userEntry.SetFocus ();
            Resizable = false;
            ShowInTaskbar = false;
            Title = Catalog.GetString ("Login");
            Icon = Image.FromResource (GetType (), Resources.Icon);
        }