예제 #1
0
        private void initInicioSesion()
        {
            IniciarField               = new UILabel(new CGRect(100 + DeviceWidth, 244, 120, 20));
            IniciarField.Text          = "Iniciar Sesion";
            IniciarField.TextAlignment = UITextAlignment.Center;
            IniciarField.TextColor     = UIColor.Yellow;
            IniciarField.Font          = UIFont.FromName("HelveticaNeue", 18);
            View.Add(IniciarField);

            //login views

            LoginUserView = getRoundImageView(30 + DeviceWidth, 300, null, null);
            View.Add(LoginUserView);
            LoginPassView = getRoundImageView(30 + DeviceWidth, 360, "MLResources/Icons/icon_enter.png", null);
            View.Add(LoginPassView);
            //login text
            UserLoginTF = getInputText("Usuario");
            LoginUserView.Add(UserLoginTF);
            PassLoginTF = getInputText("Contrasena");
            LoginPassView.Add(PassLoginTF);

            DoLoginBt = new UIButton(new CGRect(205, 0, 55, 55));
            LoginPassView.Add(DoLoginBt);
            DoLoginBt.TouchUpInside += delegate {
                //navigate to mainview ?correct
                var command = ((LoginViewModel)this.ViewModel).LoginCommand;
                command.Execute(null);
                LoadingView = new LoadingOverlay(new CGRect(0, 0, 320, 568));
                View.Add(LoadingView);
            };



            //registrarse button
            GoToRegisterBt = new UIButton(new CGRect(200 + DeviceWidth, 426, 100, 22));
            GoToRegisterBt.SetTitle("Register", UIControlState.Normal);
            GoToRegisterBt.SetTitleColor(UIColor.Yellow, UIControlState.Normal);
            View.Add(GoToRegisterBt);
            GoToRegisterBt.TouchUpInside += delegate {
                //go to register/ sign up
                registeranimate(-1.0f * DeviceWidth, true);
                loginanimate(-1.0f * DeviceWidth, false);
                login_state = -1;
                sign_state  = 0;
            };

            //registrarse button Back
            BackLoginBt = new UIButton(new CGRect(40 + DeviceWidth, 426, 100, 22));
            BackLoginBt.SetTitle("Back", UIControlState.Normal);
            BackLoginBt.SetTitleColor(UIColor.Yellow, UIControlState.Normal);
            View.Add(BackLoginBt);
            BackLoginBt.TouchUpInside += delegate {
                //go to back view

                socialanimate(DeviceWidth, true, true);
                social_state = 0;
                loginanimate(DeviceWidth, true);
                login_state = 1;
            };
        }
예제 #2
0
        private void initCenter()
        {
            los_scroll           = new LOsScrollView(new CGRect(0, 48, 320, 198));
            los_scroll.DoOpenLO += (sender, lo_index) => {
                var vm1 = ViewModel as MainViewModel;


                vm1.OpenLOCommand.Execute(vm1.LearningOjectsList[0]);
                LoadingView = new LoadingOverlay(new CGRect(0, 0, 320, 568));
                View.Add(LoadingView);
            };
            CenterView.Add(los_scroll);

            var vm = ViewModel as MainViewModel;

            if (vm.LearningOjectsList != null)
            {
                los_scroll.LearningOjectsList = vm.LearningOjectsList;
            }
            vm.PropertyChanged += (sender, e) => {
                los_scroll.LearningOjectsList = vm.LearningOjectsList;
            };
        }