상속: ViewModelBase
        public override void ViewDidLoad()
        {
            viewModel = new LoginViewModel();
            //Prepare buttons for fade in animation.
            btnFacebook.Alpha = 0;
            btnTwitter.Alpha = 0;
            btnMicrosoft.Alpha = 0;
            btnSkipAuth.Alpha = 0;

            btnSkipAuth.Layer.CornerRadius = 4;
            btnSkipAuth.Layer.MasksToBounds = true;

#if DEBUG || XTC
            btnSkipAuth.Hidden = false;
#else
            btnSkipAuth.Hidden = true;
#endif
        }
예제 #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            if ((int) Build.VERSION.SdkInt >= 21)
            {
                Window.SetStatusBarColor(new Color(ContextCompat.GetColor(this, Resource.Color.primary_dark)));
                Window.DecorView.SystemUiVisibility = StatusBarVisibility.Visible;
            }

            viewModel = new LoginViewModel();
            viewModel.PropertyChanged += ViewModel_PropertyChanged;
            var twitter = FindViewById<Button>(Resource.Id.button_twitter);
            var microsoft = FindViewById<Button>(Resource.Id.button_microsoft);
            var facebook = FindViewById<Button>(Resource.Id.button_facebook);

            twitter.Click += (sender, e) => Login(LoginAccount.Twitter);
            microsoft.Click += (sender, e) => Login(LoginAccount.Microsoft);
            facebook.Click += (sender, e) => Login(LoginAccount.Facebook);

            FindViewById<Button>(Resource.Id.button_skip).Click += (sender, e) =>
            {
                viewModel.InitFakeUser();
                var intent = new Intent(this, typeof(MainActivity));
                intent.AddFlags(ActivityFlags.ClearTop);
                StartActivity(intent);
                Finish();
            };

            #if XTC || DEBUG
            #else
            FindViewById<Button>(Resource.Id.button_skip).Visibility = ViewStates.Gone;
            #endif
            var typeface = Typeface.CreateFromAsset(Assets, "fonts/Corbert-Regular.otf");
            FindViewById<TextView>(Resource.Id.text_app_name).Typeface = typeface;
        }
예제 #3
0
 public LoginView()
 {
     InitializeComponent();
     DataContext = viewModel = new LoginViewModel();
 }