public override void LoadView() { base.LoadView(); _CustomView = new XMCustomView(); // This is the custom event we bound. // This is sometimes preferable to specifying a delegate. _CustomView.ViewWasTouched += Handle_CustomViewViewWasTouched; // The XMCustomViewDelegate we bound // If we specify this it will OVERRIDE the event handler we specified // _CustomView.Delegate = new CustomViewDelegate(); // The XMCustomView Name Property _CustomView.Name = @"Anuj"; // The instance method uses a frame calculation. _CustomView.Frame = new CGRect(10, 25, 200, 200); // The instance method we bound. _CustomView.CustomizeViewWithText(string.Format(@"Yo {0}, I hurd you like bindings! MonoTouch makes it super easy with BTOUCH. Try it out!", _CustomView.Name ?? "Dawg")); var section = new Section("Custom View") { new CustomViewElement(_CustomView), }; this.Root.Add(section); }
public override void ViewWasTouched(XMCustomView view) { Console.WriteLine("Hey! Our XMCustomView was touched with frame: {0}!", view.Frame); }