Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MessageBox"/> class.
        /// </summary>
        /// <param name="Msgbox_typename">The msgbox_typename.</param>
        /// <param name="content">The content.</param>
        /// <param name="btnleft_content">The btnleft_content.</param>
        /// <param name="btnright_content">The btnright_content.</param>
        /// <param name="isUsedForForward">if set to <c>true</c> [is used for forward].</param>
        public MessageBox(string Msgbox_typename, string content, string btnleft_content, string btnright_content, bool isUsedForForward)
        {
            btnleft_Content  = btnleft_content;
            btnright_Content = btnright_content;
            IsUsedForForward = isUsedForForward;
            InitializeComponent();
            this.DataContext        = ChatDataContext.GetInstance();
            ForwardError.Visibility = System.Windows.Visibility.Hidden;
            ForwardError.Content    = "";
            if (Msgbox_typename == "close")
            {
                this.DialogResult = true;
                this.Close();
            }
            if (IsUsedForForward)
            {
                growFwd.Height     = GridLength.Auto;
                btn_left.IsEnabled = false;
            }
            else
            {
                growFwd.Height = new GridLength(0);
            }

            if (IsUsedForForward)
            {
                if (Msgbox_typename.Contains("Cancel"))
                {
                    lblTitle.Content   = Msgbox_typename;
                    btn_left.IsEnabled = true;
                }
                else
                {
                    lblTitle.Content = Msgbox_typename;
                }
            }
            else
            {
                lblTitle.Content = Msgbox_typename + " - Agent Interaction Desktop";
            }

            txtblockContent.Text = content;
            if (!string.IsNullOrEmpty(btnleft_content))
            {
                btn_left.Content = btnleft_content;
            }
            else
            {
                btn_left.Visibility = System.Windows.Visibility.Hidden;
            }
            btn_right.Content        = btnright_content;
            ShadowEffect.ShadowDepth = 0;
            ShadowEffect.Opacity     = 0.5;
            ShadowEffect.Softness    = 0.5;
            ShadowEffect.Color       = (Color)ColorConverter.ConvertFromString("#003660");
        }
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            ImageSource imgSource = null;

            if (value.ToString().ToLower().Contains("email"))
            {
                imgSource = new BitmapImage(new Uri(ChatDataContext.GetInstance().Imagepath + "\\Email\\Email.png", UriKind.Relative));
            }
            else if (value.ToString().ToLower().Contains("chat"))
            {
                imgSource = new BitmapImage(new Uri(ChatDataContext.GetInstance().Imagepath + "\\Chat\\Chat.png", UriKind.Relative));
            }
            else
            {
                imgSource = null;
            }
            return(imgSource);
        }