Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            //var loginWindowView = FindViewById<RelativeLayout>(Resource.Id.loginWindow);

            EditText loginEditTextWindow    = FindViewById <EditText>(Resource.Id.editText_user);
            EditText passwordEditTextWindow = FindViewById <EditText>(Resource.Id.editText_password);
            Switch   switchButton           = FindViewById <Switch>(Resource.Id.change_localization);
            Button   signInButton           = FindViewById <Button>(Resource.Id.button_signIn);
            Button   registrationButton     = FindViewById <Button>(Resource.Id.button_registration);
            TextView mainLabel        = FindViewById <TextView>(Resource.Id.textView_main);
            TextView loginLabel       = FindViewById <TextView>(Resource.Id.textView_username);
            TextView passwordLabel    = FindViewById <TextView>(Resource.Id.textView_password);
            TextView textViewExeption = FindViewById <TextView>(Resource.Id.textViewException);


            IDataWrap       dataWrap       = new DataWrap();
            IRouter         router         = new AndroidRouter(this);
            IAuth_Presenter auth_Presenter = new Auth_Presenter(router, this);

            auth_Presenter.Router = router;

            IAuth_Interactor auth_Intarector = new Auth_Interactor(dataWrap);

            auth_Intarector.Auth_Presenter = auth_Presenter;


            switchButton.Click += ((o, e) =>
            {
                var click = (Switch)o;
                ChangeLocalizationClick?.Invoke(click.Checked);
            });

            registrationButton.Click += ((o, e) =>
            {
                OnRegistrationClick?.Invoke();
            });

            signInButton.Click += ((o, e) =>
            {
                string login = loginEditTextWindow.Text;
                string password = passwordEditTextWindow.Text;
                OnSignInClick?.Invoke(login, password);
            });
        }
Exemplo n.º 2
0
        private void LocalizationChangeButton_TouchUpInside(object sender, EventArgs e)
        {
            var click = (UISwitch)sender;

            ChangeLocalizationClick?.Invoke(click.On);//Проверить
        }