Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ButtonElement.cs
Go to the documentation of this file.
1 using System;
2 
3 using Android.Content;
4 using Android.Views;
5 using Android.Widget;
6 
7 namespace MonoDroid.Dialog
8 {
9  public class ButtonElement : StringElement
10  {
11  public ButtonElement (string caption, Action tapped)
12  : base(caption, (int)DroidResources.ElementLayout.dialog_button)
13  {
14  this.Click = tapped;
15  }
16 
17  public override View GetView (Context context, View convertView, ViewGroup parent)
18  {
19  Button button;
20  var view = DroidResources.LoadButtonLayout (context, convertView, parent, LayoutId, out button);
21  if (view != null) {
22  button.Text = Caption;
23  if (Click != null)
24  button.Click += delegate { Click(); };
25  }
26 
27  return view;
28  }
29 
30  public override string Summary ()
31  {
32  return Caption;
33  }
34  }
35 }
override View GetView(Context context, View convertView, ViewGroup parent)
Overriden my most derived classes, creates a view that creates a View with the contents for display ...
ButtonElement(string caption, Action tapped)
override string Summary()
Returns a summary of the value represented by this object, suitable for rendering as the result of a ...