Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/269.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 单触式对话框。带有元素API的按钮_C#_Xamarin.ios_Monotouch.dialog - Fatal编程技术网

C# 单触式对话框。带有元素API的按钮

C# 单触式对话框。带有元素API的按钮,c#,xamarin.ios,monotouch.dialog,C#,Xamarin.ios,Monotouch.dialog,是否可以仅使用Elements API在视图上创建按钮 var root = new RootElement ("LoginScreen"){ new Section ("Enter your credentials") { new EntryElement ("Username", "Your user name", "user1"), new EntryElement ("Password", "Your passwo

是否可以仅使用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, true);
我知道反射API可以使用
OnTapAttribute
,但我想知道如何使用Elements API实现这一点


当用户点击按钮时,它应该按下另一个视图控制器…

哦,我想我可以像那样使用
StyledStringElement

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