Exemplo n.º 1
0
        /// <summary>
        /// This method is called when the activity is starting.
        /// It contains the logic for the buttons shown in the first view.
        /// </summary>
        /// <param name="savedInstanceState"> a Bundle that contains the data the activity most recently
        /// supplied if the activity is being re-initialized after previously being shut down. </param>
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _signUpButton        = FindViewById <Button>(Resource.Id.btnSignUp);
            _signUpButton.Click += (sender, args) =>
            {
                //Brings dialog fragment forward
                var transaction  = SupportFragmentManager.BeginTransaction();
                var dialogSignUp = new DialogSignUp();
                dialogSignUp.Show(transaction, "sign up");

                dialogSignUp.EventHandlerSignUp += SignUpResult;
            };


            _signInButton        = FindViewById <Button>(Resource.Id.btnSignIn);
            _signInButton.Click += (sender, args) =>
            {
                //Brings dialog fragment forward
                var transaction  = SupportFragmentManager.BeginTransaction();
                var dialogSignIn = new DialogSignIn();
                dialogSignIn.Show(transaction, "sign in");

                dialogSignIn.EventHandlerSignIn += SignInResult;
            };
        }
        void btnSignIn_Click(object sender, EventArgs e)
        {
            //Pull up dialog
            FragmentTransaction transaction  = FragmentManager.BeginTransaction();
            DialogSignIn        signInDialog = new DialogSignIn();

            signInDialog.Show(transaction, "Dialog Fragment");

            signInDialog.eventOnSignUp += SignInDialog_eventOnSignUp; // On new event
        }