public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            BackButton.SetCommand(ViewModel.BackCommand);
            BackButton.SetTitle(ViewModel.BackText, UIControlState.Normal);
        }
Ejemplo n.º 2
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            View.BackgroundColor = UIColor.Brown;

            /*
             * BackButton.TouchUpInside += (s, e) =>
             * {
             *  var nav = SimpleIoc.Default.GetInstance<IViewNavigationService>();
             *  nav.GoBack();
             * };
             */

            // Binding and commanding

            // Binding between the first UILabel and the NativeTitle property on the VM.
            // Keep track of the binding to avoid premature garbage collection
            bindings.Add(
                this.SetBinding(
                    () => Vm.NativeTitle,
                    () => NativeTitle.Text));

            // Actuate the Command on the VM.
            BackButton.SetCommand(
                "TouchUpInside",
                Vm.NavigateBackCommand);
        }