Esempio n. 1
0
        /// <summary>
        /// Note down current active button
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// <returns>true if, switch to new page, false otherwise</returns>
        private bool HandleActiveButton(object sender, MouseButtonEventArgs e)
        {
            // Reclick the same active button, do nothing
            if (sender as ToolbarButton == activeButton)
            {
                return(false);
            }

            // Gray out previous active button
            if (activeButton != null)
            {
                activeButton.Unselect();
            }

            // Set new active button
            activeButton = sender as ToolbarButton;
            activeButton.SelectButton();

            // Return
            return(true);
        }
Esempio n. 2
0
        private void LogoutButton_Click(object sender, MouseButtonEventArgs e)
        {
            if (activeButton != null)
            {
                activeButton.Unselect();
            }
            ToolbarButton logoutBtn = sender as ToolbarButton;

            logoutBtn.Unselect();

            // Try log out
            // TODO: logout
            ModelProvider.Instance.LogoutAsync(Logout_Handle);
        }