Ejemplo n.º 1
0
        private static DialogUserControlView generateDialogViews(DialogData dialogData)
        {
            dialogData.RenderWait = true; // For these to work, we always to want to set this.
            WindowsMessageViewModel windowsMessageViewModel = new WindowsMessageViewModel(dialogData);

            return(new DialogUserControlView(windowsMessageViewModel, new WindowsMessage(windowsMessageViewModel)));
        }
Ejemplo n.º 2
0
        public WindowsMessage(WindowsMessageViewModel windowsMessageViewModel)
        {
            try
            {
                this.DataContext = windowsMessageViewModel;
                InitializeComponent();

                switch (windowsMessageViewModel.Data.MessageButtons)
                {
                case WindowMessageButtons.AcceptDecline:
                case WindowMessageButtons.ContinueCancel:
                case WindowMessageButtons.OkCancel:
                case WindowMessageButtons.YesNo:
                    if (windowsMessageViewModel.Data.MessageButtonFocus == WindowButtonFocus.Center)
                    {
                        windowsMessageViewModel.Data.MessageButtonFocus = WindowButtonFocus.Left;
                    }
                    break;

                case WindowMessageButtons.Default:
                case WindowMessageButtons.Exit:
                case WindowMessageButtons.Ok:
                    if (windowsMessageViewModel.Data.MessageButtonFocus == WindowButtonFocus.Left ||
                        windowsMessageViewModel.Data.MessageButtonFocus == WindowButtonFocus.Right)
                    {
                        windowsMessageViewModel.Data.MessageButtonFocus = WindowButtonFocus.Center;
                    }
                    break;

                case WindowMessageButtons.YesNoCancel:
                    // TODO(DB): Determine if there needs to be logic here.
                    break;

                case WindowMessageButtons.Misc:
                    // TODO(DB): Determine if there needs to be logic here.
                    break;

                default:
                    // TODO(DB): Determine if there needs to be logic here.
                    break;
                }

                switch (windowsMessageViewModel.Data.MessageButtonFocus)
                {
                case WindowButtonFocus.Left:
                    windowsMessageViewModel.Data.FocusUIElement = leftButton;
                    break;

                case WindowButtonFocus.Center:
                    windowsMessageViewModel.Data.FocusUIElement = centerButton;
                    break;

                case WindowButtonFocus.Right:
                    windowsMessageViewModel.Data.FocusUIElement = rightButton;
                    break;
                }
            }
            catch (Exception Ex)
            {
                LogMVVM.Exception("MVVM Exception: MessageBox Enhanced user control construct error.", Ex);
            }
        }