예제 #1
0
        private void OnMenuItemCommand(string menuName)
        {
            try
            {
                switch (menuName)
                {
                case "Exit":
                    MessageCustomize.Show("Bạn muốn thoát ra ?", "THOÁT", MessageBoxButton.OKCancel, MessageImage.Question, c =>
                    {
                        if (c == MessageBoxResult.OK)
                        {
                            if (SetFocus != null)
                            {
                                SetFocus(0, null);
                            }
                            _modelAuth.LogoutAsync();
                        }
                    });

                    break;

                case ViewTypes.ChangePasswordView: CallDialog.Show(this, ViewTypes.ChangePasswordView, null);
                    break;

                case ViewTypes.UserSettingView: CallDialog.Show(this, ViewTypes.UserSettingView, c =>
                    {
                        if (c == MessageBoxResult.OK)
                        {
                            MessageCustomize.Show("Bạn muốn thay đổi giao diện ?", "THIẾT LẬP", MessageBoxButton.OKCancel, MessageImage.Question, d =>
                            {
                                if (d == MessageBoxResult.OK)
                                {
                                    if (SetFocus != null)
                                    {
                                        SetFocus(0, null);
                                        SetFocus(2, null);
                                    }
                                }
                            });
                        }
                    });
                    break;

                default: AppMessages.ChangeMenuItemMessage.Send(menuName);
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageCustomize.Show(ex.Message);
            }
        }
예제 #2
0
        private void OnMenuItemCommand(string menuName)
        {
            try
            {
                switch (menuName)
                {
                case "Exit":
                    _modelAuth.LogoutAsync();
                    break;

                case "ChangePasswordView": CallDialog.Show(this, ViewTypes.ChangePasswordView, null);
                    break;

                default: AppMessages.ChangeMenuItemMessage.Send(menuName);
                    break;
                }
            }
            catch (Exception ex)
            {
                MessageCustomize.Show(ex.Message);
            }
        }