示例#1
0
        public PanelManager(IMainPage main, IPanel startingPanel = null)
        {
            this.InitializeComponent();

            // Create
            m_mainPage = main;

            // Set the initial panel size size
            OnScreenSizeChanged((int)Window.Current.Bounds.Width, true);
            Window.Current.SizeChanged += Windows_SizeChanged;

            // Set the starting panel
            if (startingPanel != null)
            {
                startingPanel.PanelSetup(this, new Dictionary <string, object>());
                FireOnNavigateTo(startingPanel);
                m_panelStack.Add(new StackItem()
                {
                    Panel = startingPanel, Id = "StartingPanel"
                });
                ui_contentRoot.Children.Add((UserControl)startingPanel);
            }

            // Set the back button
            UpdateBackButton();

            // Register for app suspend commands
            App.BaconMan.OnSuspending += OnSuspending;
            App.BaconMan.OnResuming   += OnResuming;

            // Register for memory pressure callbacks
            App.BaconMan.MemoryMan.OnMemoryCleanUpRequest += MemoryMan_OnMemoryCleanUpRequest;
        }
        public PanelManager(IMainPage main, IPanel startingPanel = null)
        {
            this.InitializeComponent();

            // Create
            m_mainPage = main;

            // Set the initial panel size size
            OnScreenSizeChanged((int)Window.Current.Bounds.Width, true);
            Window.Current.SizeChanged += Windows_SizeChanged;

            // Set the starting panel
            if (startingPanel != null)
            {
                startingPanel.PanelSetup(this, new Dictionary<string, object>());
                FireOnNavigateTo(startingPanel);
                m_panelStack.Add(new StackItem() { Panel = startingPanel, Id = "StartingPanel" });
                ui_contentRoot.Children.Add((UserControl)startingPanel);
            }

            // Set the back button
            UpdateBackButton();

            // Register for app suspend commands
            App.BaconMan.OnSuspending += OnSuspending;
            App.BaconMan.OnResuming += OnResuming;

            // Register for memory pressure callbacks
            App.BaconMan.MemoryMan.OnMemoryCleanUpRequest += MemoryMan_OnMemoryCleanUpRequest;
        }