Ejemplo n.º 1
0
 private BitmapSource getIcon(WindowMessageIcon icontype)
 {
     try
     {
         Icon icon = (Icon)typeof(SystemIcons).GetProperty(Convert.ToString(icontype), BindingFlags.Public | BindingFlags.Static).GetValue(null, null);
         return(Imaging.CreateBitmapSourceFromHIcon(icon.Handle, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions()));
     }
     catch (Exception Ex)
     {
         LogMVVM.Exception("MVVM Exception: MessageBox Enhanced error when reading icon type to image.", Ex);
         return(null);
     }
 }
Ejemplo n.º 2
0
 // Sets Window Title, Message Header, Message Body, Message HyperLink Text, Message HyperLink Uri, Message Buttons, Message Icon, and Color Set.
 public static WindowMessageResult Show(string windowTitle, string contentHeader, string contentBody, string hyperLinkText, string hyperLinkUri, WindowMessageButtons windowMessageButtons, WindowMessageIcon windowMessageIcon, WindowMessageColorSet windowMessageColorSet)
 {
     return(OpenWindowMessage(dialogDataBuilder(windowTitle, contentHeader, contentBody, hyperLinkText, hyperLinkUri, windowMessageButtons, windowMessageIcon)));
 }
Ejemplo n.º 3
0
 // Sets Window Title, Message Header, Message Body, Message HyperLink, Message Buttons, and Message Icon.
 public static WindowMessageResult Show(string windowTitle, string contentHeader, string contentBody, string hyperLink, WindowMessageButtons windowMessageButtons, WindowMessageIcon windowMessageIcon)
 {
     return(OpenWindowMessage(dialogDataBuilder(windowTitle, contentHeader, contentBody, "", hyperLink, windowMessageButtons, windowMessageIcon)));
 }
 // Sets Window Title, Message Header, Message Body, Message Buttons, and Message Icon on target window.
 public static WindowMessageResult Show(Window parentWindow, string windowTitle, string contentHeader, string contentBody, WindowMessageButtons windowMessageButtons, WindowMessageIcon windowMessageIcon)
 {
     return(OpenWindowMessage(dialogDataBuilder(windowTitle, contentHeader, contentBody, "", "", windowMessageButtons, windowMessageIcon), parentWindow));
 }
Ejemplo n.º 5
0
        } = new WindowMessageColorSet();                                                          // Plans for the future.

        // Takes the arguments from the overload methods to create a DialogData object. This is what is passed to the DialogService and used to open the MessageBox Enhanced window.
        private static DialogData dialogDataBuilder(
            string windowTitle   = "",
            string contentHeader = "",
            string contentBody   = "",
            string hyperLinkText = "",
            string hyperLinkUri  = "",
            WindowMessageButtons windowMessageButtons   = WindowMessageButtons.Ok,
            WindowMessageIcon windowMessageIcon         = WindowMessageIcon.Information,
            WindowMessageColorSet windowMessageColorSet = null)
        {
            DialogData data = new DialogData()
            {
                WindowTitle    = windowTitle,
                ContentBody    = contentBody,
                ContentHeader  = contentHeader,
                HyperLinkText  = hyperLinkText,
                HyperLinkUri   = hyperLinkUri,
                MessageButtons = windowMessageButtons,
                MessageIcon    = windowMessageIcon,
            };

            if (windowMessageColorSet == null)
            {
                data.Background                  = ColorSets.Background;
                data.ContentHeaderColor          = ColorSets.ContentHeaderColor;
                data.ContentBodyColor            = ColorSets.ContentBodyColor;
                data.HyperLinkColor              = ColorSets.HyperLinkColor;
                data.HyperLinkMouseOverColor     = ColorSets.HyperLinkMouseOverColor;
                data.HyperLinkMouseDisabledColor = ColorSets.HyperLinkMouseDisabledColor;
            }
            else
            {
                if (windowMessageColorSet.Background == null)
                {
                    data.Background = ColorSets.Background;
                }

                if (windowMessageColorSet.ContentHeaderColor == null)
                {
                    data.ContentHeaderColor = ColorSets.ContentHeaderColor;
                }

                if (windowMessageColorSet.ContentBodyColor == null)
                {
                    data.ContentBodyColor = ColorSets.ContentBodyColor;
                }

                if (windowMessageColorSet.HyperLinkColor == null)
                {
                    data.HyperLinkColor = ColorSets.HyperLinkColor;
                }

                if (windowMessageColorSet.HyperLinkMouseOverColor == null)
                {
                    data.HyperLinkMouseOverColor = ColorSets.HyperLinkMouseOverColor;
                }

                if (windowMessageColorSet.HyperLinkMouseDisabledColor == null)
                {
                    data.HyperLinkMouseDisabledColor = ColorSets.HyperLinkMouseDisabledColor;
                }
            }

            return(data);
        }
 // Sets Window Title, Message Header, Message Body, Message HyperLink Text, Message HyperLink Uri, Message Buttons, and Message Icon on target window.
 public static WindowMessageResult Show(ViewModelBase viewModelBase, string windowTitle, string contentHeader, string contentBody, string hyperLinkText, string hyperLinkUri, WindowMessageButtons windowMessageButtons, WindowMessageIcon windowMessageIcon)
 {
     return(OpenWindowMessage(dialogDataBuilder(windowTitle, contentHeader, contentBody, hyperLinkText, hyperLinkUri, windowMessageButtons, windowMessageIcon), viewModelBase));
 }
 // Sets Window Title, Message Content, Message Buttons, and Message Icon on target window.
 public static WindowMessageResult Show(ViewModelBase viewModelBase, string windowTitle, string contentHeader, WindowMessageButtons windowMessageButtons, WindowMessageIcon windowMessageIcon)
 {
     return(OpenWindowMessage(dialogDataBuilder(windowTitle, contentHeader, "", "", "", windowMessageButtons, windowMessageIcon), viewModelBase));
 }