开发者

MonoTouch Dialog. Buttons with the Elements API

开发者 https://www.devze.com 2023-04-11 14:17 出处:网络
Is it possible to create buttons on the view using only Elements API? var root = new RootElement (\"LoginScreen\"){

Is it possible to create buttons on the view using only Elements API?

var root = 
    new RootElement ("LoginScreen"){
        new Section ("Enter your credentials") {
            new EntryElement ("Username", "Your user name", "user1"),
            new EntryElement ("Password", "Your password", "", isPassword:true),
    },
    new Section () {
        new RootElement ("Login"){ 
               //Here should be a button
        }
   },
   new Section () {
        new BooleanElement ("Save your credentials", false),
   },
};

var dv = new MainController (root, true){ Autorotate = true };
navigation.PushViewController (dv, tru开发者_C百科e);

I know it's possible with Reflection API using OnTapAttribute, but I wonder how to do that with Elements API.

And when user taps on the button it should Push another view controller...


Oh I guess I can use StyledStringElement like that

new StyledStringElement ("Login", delegate{ DoLogin (); })
0

精彩评论

暂无评论...
验证码 换一张
取 消