Ejemplo n.º 1
0
        //
        public PromptBox(string title, object content, PromptBoxIcon iconType = PromptBoxIcon.None)
        {
            InitializeComponent();

            // setup up dialog fields
            tb_title.Visibility = Visibility.Collapsed;
            if (title != null)
            {
                tb_title.Visibility = Visibility.Visible;
                tb_title.Text       = title;
                tb_title.Background = new SolidColorBrush(cl_Neutral);
            }

            tb_msg.Visibility        = Visibility.Collapsed;
            frame_buttons.Visibility = Visibility.Collapsed;
            cc_msg.Content           = content;

            switch (iconType)
            {
            case PromptBoxIcon.None:
                i_icon.Visibility = Visibility.Collapsed;
                break;

            case PromptBoxIcon.Question:
                i_icon.Source       = new BitmapImage(new Uri(@"Images/question.jpg", UriKind.Relative));
                tb_title.Background = new SolidColorBrush(cl_Info);
                break;

            case PromptBoxIcon.Info:
                i_icon.Source       = new BitmapImage(new Uri(@"Images/info.png", UriKind.Relative));
                tb_title.Background = new SolidColorBrush(cl_Info);
                break;

            case PromptBoxIcon.Warning:
                i_icon.Source       = new BitmapImage(new Uri(@"Images/warning.jpg", UriKind.Relative));
                tb_title.Background = new SolidColorBrush(cl_Warning);
                break;

            case PromptBoxIcon.Error:
                i_icon.Source       = new BitmapImage(new Uri(@"Images/error.png", UriKind.Relative));
                tb_title.Background = new SolidColorBrush(cl_Error);
                break;

            case PromptBoxIcon.Prompt:
                i_icon.Source       = new BitmapImage(new Uri(@"Images/prompt.png", UriKind.Relative));
                tb_title.Background = new SolidColorBrush(cl_Info);
                break;

            case PromptBoxIcon.Logout:
                i_icon.Source = new BitmapImage(new Uri(@"Images/logout.png", UriKind.Relative));
                break;
            }
        }
Ejemplo n.º 2
0
        //
        public PromptBox(string title, object content, PromptBoxIcon iconType = PromptBoxIcon.None)
        {
            InitializeComponent();

            // setup up dialog fields
            tb_title.Visibility = Visibility.Collapsed;
            if (title != null)
            {
                tb_title.Visibility = Visibility.Visible;
                tb_title.Text = title;
                tb_title.Background = new SolidColorBrush(cl_Neutral);
            }

            tb_msg.Visibility = Visibility.Collapsed;
            frame_buttons.Visibility = Visibility.Collapsed;
            cc_msg.Content = content;

            switch (iconType)
            {
                case PromptBoxIcon.None:
                    i_icon.Visibility = Visibility.Collapsed;
                    break;
                case PromptBoxIcon.Question:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/question.jpg", UriKind.Relative));
                    tb_title.Background = new SolidColorBrush(cl_Info);
                    break;
                case PromptBoxIcon.Info:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/info.png", UriKind.Relative));
                    tb_title.Background = new SolidColorBrush(cl_Info);
                    break;
                case PromptBoxIcon.Warning:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/warning.jpg", UriKind.Relative));
                    tb_title.Background = new SolidColorBrush(cl_Warning);
                    break;
                case PromptBoxIcon.Error:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/error.png", UriKind.Relative));
                    tb_title.Background = new SolidColorBrush(cl_Error);
                    break;
                case PromptBoxIcon.Prompt:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/prompt.png", UriKind.Relative));
                    tb_title.Background = new SolidColorBrush(cl_Info);
                    break;
                case PromptBoxIcon.Logout:
                    i_icon.Source = new BitmapImage(new Uri(@"Images/logout.png", UriKind.Relative));
                    break;
            }
        }