Пример #1
0
        public async Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams)
        {
            var r =
                await
                _api.ShowMessageBox(dialogParams.Title, dialogParams.Message, GetButtons(dialogParams))
                .ConfigureAwait(false);

            return((SixMessageBoxResult)Enum.Parse(typeof(SixMessageBoxResult), r));
        }
Пример #2
0
        public async Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams)
        {
            var ev = GetMessageBoxViewModel(dialogParams);

            await ShowDialog(ev);

            var vm = ev;

            return(vm.Result);
        }
Пример #3
0
        // TODO: Consider using messageboxes directly like any other View with actions?
        protected async Task <SixMessageBoxResult> MetroMessageBox(MessageBoxDialogParams dialogParams)
        {
            ConfirmAccess();
            var ev = GetMetroMessageBoxViewModel(dialogParams);

            await ShowMetroDialog(ev);

            var vm = ev;

            return(vm.Result);
        }
Пример #4
0
        static MetroMessageBoxViewModel GetMetroMessageBoxViewModel(MessageBoxDialogParams dialogParams)
        {
            MetroMessageBoxViewModel ev;

            if (dialogParams.IgnoreContent)
            {
                ev = new MetroMessageBoxViewModel(dialogParams.Message, dialogParams.Title,
                                                  GetButton(dialogParams.Buttons), dialogParams.RememberedState);
            }
            else
            {
                ev = new MetroMessageBoxViewModel(dialogParams.Message, dialogParams.Title,
                                                  GetButton(dialogParams.Buttons), dialogParams.RememberedState)
                {
                    GreenButtonContent = dialogParams.GreenContent,
                    BlueButtonContent  = dialogParams.BlueContent,
                    RedButtonContent   = dialogParams.RedContent
                };
            }
            return(ev);
        }
Пример #5
0
        private static string[] GetButtons(MessageBoxDialogParams dialogParams)
        {
            switch (dialogParams.Buttons)
            {
            case SixMessageBoxButton.OK: {
                return(new[] { "OK" });
            }

            case SixMessageBoxButton.OKCancel: {
                return(new[] { "OK", "Cancel" });
            }

            case SixMessageBoxButton.YesNo: {
                return(new[] { "Yes", "No" });
            }

            case SixMessageBoxButton.YesNoCancel: {
                return(new[] { "Yes", "No", "Cancel" });
            }
            }
            throw new NotSupportedException("Unsupported messagebox option");
        }
 public Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams)
 {
     throw new NotImplementedException();
 }
Пример #7
0
 public Task <SixMessageBoxResult> MessageBox(MessageBoxDialogParams dialogParams) => _wm.MessageBox(dialogParams);