Exemplo n.º 1
0
        public object GetViewInstance(PageContext context)
        {
            object view = null;

            try
            {
                if (ViewType.IsSubclassOf(typeof(PageBase)))
                {
                    view = Activator.CreateInstance(ViewType);
                    (view as PageBase).Context = context;
                }
                else
                {
                    view = Activator.CreateInstance(ViewType, new object[] { context });
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(view);
        }