protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); power = new Power (2); // Set our view from the "main" layout resource SetContentView(Resource.Layout.Main); // Get our button from the layout resource, // and attach an event to it Button button = FindViewById<Button>(Resource.Id.MyButton); button.Click += delegate { RunTests (); var number = power.Compute (count++); button.Text = string.Format("{0} is the power", number); }; }
static void Main(string[] args) { var power = new Power (8); Console.WriteLine (power.Compute (8)); Console.WriteLine (TestWeb.TestType ().FullName); var test = new TestWeb (); var task = test.TestAsync ("http://www.xamarin.com/"); var res = task.Result; Console.WriteLine (res); var windows = new TestSystemWindows (); var notify = windows.Test () as INotifyCollectionChanged; notify.CollectionChanged += delegate { Console.WriteLine ("COLLECTION CHANGED!"); }; Console.WriteLine (notify); }
public override void ViewDidLoad() { base.ViewDidLoad (); // Perform any additional setup after loading the view, typically from a nib. power = new Power (4); }
// Shared initialization code void Initialize() { power = new Power (8); }