Beispiel #1
0
        /// <summary>
        /// Event when the app is brought back to the foreground or screen unlocked
        /// </summary>
        public override void WillEnterForeground(UIApplication application)
        {
            var loginViewModel = ServiceContainer.Resolve <LoginViewModel>();

            if (loginViewModel.IsInactive)
            {
                Theme.TransitionController(loginController, false);
            }

            //Let's reset the time, just to be safe
            loginViewModel.ResetInactiveTime();
        }
Beispiel #2
0
        partial void Login()
        {
            //Dismiss the keyboard
            username.ResignFirstResponder();
            password.ResignFirstResponder();

            loginViewModel
            .LoginAsync()
            .ContinueWith(_ =>
                          BeginInvokeOnMainThread(() => {
                if (tabController == null)
                {
                    tabController = Storyboard.InstantiateViewController <TabController>();
                }

                Theme.TransitionController(tabController);
            }));
        }
        /// <summary>
        /// Event when the settings toolbar item is clicked
        /// </summary>
        partial void Settings(MonoTouch.UIKit.UIBarButtonItem sender)
        {
            if (actionSheet == null)
            {
                actionSheet = new UIActionSheet();
                actionSheet.AddButton("Logout");
                actionSheet.Dismissed += (s, e) => {
                    if (e.ButtonIndex == 0)
                    {
                        var loginController = Storyboard.InstantiateViewController <LoginController>();
                        Theme.TransitionController(loginController);
                    }

                    actionSheet.Dispose();
                    actionSheet = null;
                };
                actionSheet.ShowFrom(sender as UIBarButtonItem, true);
            }
            else
            {
                actionSheet.DismissWithClickedButtonIndex(-1, true);
            }
        }