예제 #1
0
 private PUMessageBox(string title, string content, bool isConfirm, bool showInTaskBar, AnimationStyles animateStyle)
 {
     InitializeComponent();
     Title           = title;
     txtContent.Text = content;
     try
     {
         _parentWindow = GetOwnerWindow();
     }
     catch (Exception ex)
     { }
     if (_parentWindow != null)
     {
         _parentWindow.IsCoverMaskShow = true;
     }
     if (isConfirm)
     {
         groupTip.Visibility     = Visibility.Collapsed;
         groupConfirm.Visibility = Visibility.Visible;
     }
     ShowInTaskbar  = showInTaskBar;
     AnimationStyle = animateStyle;
     if (_parentWindow != null)
     {
         Owner = _parentWindow;
     }
 }
예제 #2
0
 private PUMessageBox(string title, string content, bool showInTaskBar, AnimationStyles animateStyle)
 {
     InitializeComponent();
     Title                   = title;
     txtContent.Text         = content;
     _parentWindow           = GetOwnerWindow();
     _parentWindow.ShowCover = true;
     ShowInTaskbar           = showInTaskBar;
     AnimationStyle          = animateStyle;
     Owner                   = _parentWindow;
 }
예제 #3
0
        public PieChart()
        {
            InitializeComponent();
            DoubleBuffered = true;
            CheckForIllegalCrossThreadCalls = false;

            LegendsFont    = new Font(Font.FontFamily, 9, FontStyle.Regular);
            AnimationStyle = AnimationStyles.NON_UNIFORM;

            PieWidth      = 12;
            BoundaryColor = Color.Black;
        }
예제 #4
0
 private PUMessageBox(string title, string content, bool isConfirm, bool showInTaskBar, AnimationStyles animateStyle)
 {
     InitializeComponent();
     Title           = title;
     txtContent.Text = content;
     if (isConfirm)
     {
         groupTip.Visibility     = Visibility.Collapsed;
         groupConfirm.Visibility = Visibility.Visible;
     }
     ShowInTaskbar  = showInTaskBar;
     AnimationStyle = animateStyle;
 }
예제 #5
0
        /// <summary>
        /// 打开一个消息确认对话框,并打开父窗体的遮罩层。
        /// </summary>
        /// <param name="content">要显示的内容。</param>
        /// <param name="title">标题内容。</param>
        /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param>
        public static bool?ShowConfirm(string content, string title = "提示", Buttons buttons = Buttons.YesOrNo, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale)
        {
            var mbox = new PUMessageBox(title, content, true, showInTaskBar, animateStyle);

            switch (buttons)
            {
            case Buttons.YesOrNo:
                mbox.BtnYes.Content = "是";
                mbox.BtnNo.Content  = "否";
                break;

            case Buttons.YesOrCancel:
                mbox.BtnYes.Content = "是";
                mbox.BtnNo.Content  = "取消";
                break;

            case Buttons.OKOrCancel:
                mbox.BtnYes.Content = "确定";
                mbox.BtnNo.Content  = "取消";
                break;

            case Buttons.AcceptOrRefused:
                mbox.BtnYes.Content = "接受";
                mbox.BtnNo.Content  = "拒绝";
                break;

            case Buttons.AcceptOrCancel:
                mbox.BtnYes.Content = "接受";
                mbox.BtnNo.Content  = "取消";
                break;
            }
            if (!showInTaskBar)
            {
                mbox.ShowInTaskbar = false;
            }
            mbox.ShowDialog();
            return(mbox.DialogResult);
        }
예제 #6
0
        /// <summary>
        /// 打开一个消息提示对话框,并打开父窗体的遮罩层。
        /// </summary>
        /// <param name="content">要显示的内容。</param>
        /// <param name="title">标题内容。</param>
        /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param>
        public static void ShowDialog(string content, string title = "提示", bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale)
        {
            var mbox = new PUMessageBox(title, content, false, showInTaskBar, animateStyle);

            if (!showInTaskBar)
            {
                mbox.ShowInTaskbar = false;
            }
            mbox.ShowDialog();
        }
예제 #7
0
        /// <summary>
        /// 打开一个消息确认对话框,并打开父窗体的遮罩层。
        /// </summary>
        /// <param name="content">要显示的内容。</param>
        /// <param name="title">标题内容。</param>
        /// <param name="buttons">按钮内容,默认为“是/否”</param>
        /// <param name="showInTaskBar">是否在任务栏中显示,默认为True。</param>
        public static bool?ShowConfirm(string content, string title = "提示", Buttons buttons = Buttons.YesOrNo, bool showInTaskBar = true, AnimationStyles animateStyle = AnimationStyles.Scale)
        {
            var mbox = new PUMessageBox(title, content, true, showInTaskBar, animateStyle);

            mbox.CheckButtonContent(buttons);
            if (!showInTaskBar)
            {
                mbox.ShowInTaskbar = false;
            }
            mbox.ShowDialog();
            return(mbox.DialogResult);
        }
예제 #8
0
        /// <summary>
        /// 打开一个等待界面,并打开父窗体的遮罩层。该界面将以Show的方式打开,但用户不能使用Alt+F4强制关闭此页面。若要关闭此界面,请调用PUMessageBox.CloseAwait()方法。
        /// </summary>
        /// <param name="content">要显示的内容</param>
        /// <param name="title">标题内容。</param>
        /// <param name="cancelCallback">若允许用户取消等待,则必须指定点击取消按钮后的后续处理。用户点击了取消按钮,该窗体需要您手动关闭。若不指定后续处理,取消按钮将被禁用。</param>
        public static void ShowAwait(string content, string title = "提示", RoutedEventHandler cancelCallback = null, AnimationStyles animateStyle = AnimationStyles.Scale)
        {
            var mbox = new PUMessageBox(title, "", false, false, animateStyle);

            mbox.AllowForcingClose = false;
            _instance = mbox;
            mbox.CheckButtonContent(Buttons.Cancel);
            mbox._cancel             = cancelCallback;
            mbox.Topmost             = true;
            mbox.grdAwait.Visibility = Visibility.Visible;
            mbox.loading.IsRunning   = true;
            mbox.txtAwait.Text       = content;
            mbox.Show();
        }