Exemple #1
0
        public void ExecuteConfimIcon(Grid bodyPanel, string msg, IconEnumType icon, RoutedEventHandler closeAction, RoutedEventHandler submitAction,
                                      string title = "提示", string closeName = "关闭", string submitName = "确定")
        {
            try
            {
                _onControlRender.ThreadExecuteUI(() =>
                {
                    var TipConfirm    = new TipConfirmBox();
                    TipConfirm.Margin = new Thickness(0, 0, 0, 0);

                    TipConfirm.Title      = title;
                    TipConfirm.WidthIcon  = 90;
                    TipConfirm.Content    = msg;
                    TipConfirm.BoxType    = BoxType.Small;
                    TipConfirm.Icon       = new BitmapImage(new Uri(icon.GetDescription(), UriKind.RelativeOrAbsolute));
                    TipConfirm.CloseName  = closeName;
                    TipConfirm.SubmitName = submitName;
                    TipConfirm.OnClose   += closeAction;
                    TipConfirm.OnSubmit  += submitAction;

                    bodyPanel.RegisterName("tipConfirm" + Guid.NewGuid().ToString().RemoveChar('-'), TipConfirm);
                    bodyPanel.Children.Add(TipConfirm);
                });
            }
            catch (Exception ex)
            {
                TextHelper.Error("ExecuteConfim 异常", ex);
            }
        }
Exemple #2
0
        public void ExecuteConfimBigIcon(Grid bodyPanel, string msg, IconEnumType icon, RoutedEventHandler closeAction, RoutedEventHandler submitAction,
                                         string title = "提示", string closeName = "关闭", string submitName = "确定", int IconWidth = 90)
        {
            try
            {
                _onControlRender.ThreadExecuteUI(() =>
                {
                    #region 判断是否存在TipConfirmBox
                    if (IsExistsTipConfirmBox(bodyPanel))
                    {
                        return;
                    }
                    #endregion

                    var TipConfirm    = new TipConfirmBox();
                    var height        = bodyPanel.RenderSize.Height;
                    TipConfirm.Margin = new Thickness(0, 0, 0, 0);

                    TipConfirm.BoxHeight  = Convert.ToInt32(bodyPanel.RenderSize.Height);
                    TipConfirm.BoxWidth   = Convert.ToInt32(bodyPanel.RenderSize.Width);
                    TipConfirm.Title      = title;
                    TipConfirm.TitleSize  = 20;
                    TipConfirm.WidthIcon  = IconWidth;
                    TipConfirm.Content    = msg;
                    TipConfirm.Icon       = new BitmapImage(new Uri(icon.GetDescription(), UriKind.RelativeOrAbsolute));
                    TipConfirm.CloseName  = closeName;
                    TipConfirm.SubmitName = submitName;
                    TipConfirm.OnClose   += closeAction;
                    if (string.IsNullOrEmpty(closeName))
                    {
                        TipConfirm.ButtonWidth = 310;
                    }
                    else
                    {
                        TipConfirm.ButtonWidth = 145;
                    }
                    TipConfirm.BoxType   = BoxType.Big;
                    TipConfirm.OnSubmit += submitAction;


                    bodyPanel.RegisterName("tipConfirm" + Guid.NewGuid().ToString().RemoveChar('-'), TipConfirm);
                    bodyPanel.Children.Add(TipConfirm);
                });
            }
            catch (Exception ex)
            {
                TextHelper.Error("ExecuteConfim 异常", ex);
            }
        }