Exemplo n.º 1
0
        /// <summary>
        /// 打开模态窗口
        /// </summary>
        /// <param name="page">内容页面</param>
        /// <param name="icon">图标</param>
        /// <param name="pageTitle">页面标题</param>
        /// <param name="args">页面传参</param>
        /// <param name="callback">关闭窗体后执行的回调函数</param>
        /// <param name="disableArea">是否禁用弹框页面的保存,取消区域(即隐藏保存,取消按钮)</param>
        protected void ShowDialog(string page, IconEnum icon, string pageTitle = "未设置标题", object args = null, Action <IDialogResult> callback = null, bool disableArea = false)
        {
            IDialogWindow dialogWindow = Container.Resolve <IDialogWindow>("dialog");

            dialogWindow.ConfigureDialogWindowEvents(callback);

            DialogParameters pars = new DialogParameters();

            pars.Add("page", page);
            pars.Add("icon", icon.ToDescription());
            pars.Add("title", pageTitle);
            if (disableArea)
            {
                pars.Add("disableArea", true);
            }
            if (args != null)
            {
                pars.Add("args", args.ToJson());
            }
            dialogWindow.ConfigureDialogWindowContent("CommonDialogPage", pars);
            dialogWindow.ShowDialog();
        }