Esempio n. 1
0
        private void CreateViewManager()
        {
            // Create the view manager instance
            ViewManager = new ViewManager(this, new ViewLayoutPageShow(this));

            // Ask the view builder to create the view for the default mode
            _viewBuilder = ViewBuilderBase.CreateViewBuilder(_mode);
            _viewBuilder.Construct(this, ViewManager, Redirector);

            // We need to know when the layout cycle is starting/ending
            ViewManager.LayoutBefore += new EventHandler(OnViewManagerLayoutBefore);
            ViewManager.LayoutAfter += new EventHandler(OnViewManagerLayoutAfter);
        }
Esempio n. 2
0
        /// <summary>
        /// Raises the Initialized event.
        /// </summary>
        /// <param name="e">An EventArgs that contains the event data.</param>
        protected override void OnInitialized(EventArgs e)
        {
            // Ignore call as view builder is already destructed
            if (!IsDisposed && (_viewBuilder != null))
            {
                // Let base class generate standard event
                base.OnInitialized(e);

                // Ask the view builder to pull down current view
                _viewBuilder.Destruct();

                // Ask the view builder to create new view based on new mode
                _viewBuilder = ViewBuilderBase.CreateViewBuilder(_mode);
                _viewBuilder.Construct(this, ViewManager, Redirector);

                if (LayoutOnInitialized)
                {
                    // Force a layout now that initialization is complete
                    OnLayout(new LayoutEventArgs(null, null));
                }
            }
        }