Exemplo n.º 1
0
        public static MessageBoxResult Show(string message, string title = null, Window owner = null, MessageBoxButton messageBoxButton = MessageBoxButton.OK, MessageBoxXConfigurations configurations = null)
        {
            if (configurations == null)
                configurations = new MessageBoxXConfigurations();

            return CallMsgBox(owner, message, title, messageBoxButton, configurations);
        }
Exemplo n.º 2
0
        public static MessageBoxResult Show(string message, string title = null, Window owner = null, MessageBoxButton messageBoxButton = MessageBoxButton.OK, string configKey = null)
        {
            MessageBoxXConfigurations messageBoxXConfigurations = null;

            if (configKey.IsNullOrEmpty())
                messageBoxXConfigurations = new MessageBoxXConfigurations();
            else
            {
                if (!MessageBoxXConfigurations.ContainsKey(configKey))
                    throw new Exception($"Configuration key \"{configKey}\" does not exists.");

                messageBoxXConfigurations = MessageBoxXConfigurations[configKey];
            }

            return CallMsgBox(owner, message, title, messageBoxButton, messageBoxXConfigurations);
        }
Exemplo n.º 3
0
        private static MessageBoxResult CallMsgBox(Window owner, string message, string title, MessageBoxButton messageBoxButton, MessageBoxXConfigurations configurations)
        {
            var msb = new MsgBox(owner, message, title, messageBoxButton, configurations);

            WindowX windowX = null;

            if (configurations.InteractOwnerMask && owner != null && owner is WindowX)
            {
                windowX = owner as WindowX;
            }

            if (windowX != null)
            {
                windowX.IsMaskVisible = true;
            }
            msb.ShowDialog();
            if (windowX != null)
            {
                windowX.IsMaskVisible = false;
            }

            return(msb.MessageBoxResult);
        }
Exemplo n.º 4
0
 static MessageBoxX()
 {
     Configurations = new MessageBoxXConfigurations();
 }