| 1234567891011121314151617181920212223242526272829303132333435 |
- using Cirrious.MvvmCross.Binding.BindingContext;
- using Cirrious.MvvmCross.Touch.Views;
- using CoreGraphics;
- using Foundation;
- using ObjCRuntime;
- using UIKit;
- namespace $rootnamespace$.Views
- {
- [Register("FirstView")]
- public class FirstView : MvxViewController
- {
- public override void ViewDidLoad()
- {
- View = new UIView { BackgroundColor = UIColor.White };
- base.ViewDidLoad();
- // ios7 layout
- if (RespondsToSelector(new Selector("edgesForExtendedLayout")))
- {
- EdgesForExtendedLayout = UIRectEdge.None;
- }
-
- var label = new UILabel(new CGRect(10, 10, 300, 40));
- Add(label);
- var textField = new UITextField(new CGRect(10, 50, 300, 40));
- Add(textField);
- var set = this.CreateBindingSet<FirstView, Core.ViewModels.FirstViewModel>();
- set.Bind(label).To(vm => vm.Hello);
- set.Bind(textField).To(vm => vm.Hello);
- set.Apply();
- }
- }
- }
|