示例#1
0
        private bool ProcessProxy()
        {
            var proxy = GetComponent() as PageProxy;

            if (proxy != null)
            {
                proxy.LoadPinned();

                XamlUtil.UsingRender((brush) =>
                {
                    proxy.OnLoad(); //OnLoad的触发,必须在呈现环境初始化之后进行
                    proxy.Process(this.PageContext);
                });
                return(true);
            }
            return(false);
        }
示例#2
0
        protected override object CallWebMethod(object[] args)
        {
            //在处理事件之前,先加载固化值
            UIElement component = this.GetComponent() as UIElement;

            if (component == null)
            {
                throw new XamlException("无法处理事件,组件不是" + typeof(UIElement).FullName);
            }
            component.LoadPinned();

            object result = null;

            XamlUtil.UsingRender((brush) =>
            {
                component.OnLoad();
                result = CallWebMethod(component, args);
            });
            return(result);
        }
示例#3
0
        private static string GetPageCode(UIElement element, string error)
        {
            //在获取页面代码之前,先加载固化值
            element.LoadPinned();

            if (!string.IsNullOrEmpty(error))
            {
                SetError(element, error);
            }

            var code = string.Empty;

            XamlUtil.UsingRender((brush) =>
            {
                element.OnLoad(); //OnLoad的触发,必须在呈现环境初始化之后进行

                AppendLanguage(brush);
                element.Render(brush);
                code = brush.GetCode();
            });
            return(code);
        }