Esempio n. 1
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            NavigationContext.QueryString.TryGetValue("game", out gamefolder);
            //ColumnDefinition render = new ColumnDefinition(), blank = new ColumnDefinition();
            //, button = new ColumnDefinition()
            if (ONSCL_GameInfoPage.nsg == null)
            {
                ONSCL_GameInfoPage.nsg = new NSGameSettings(gamefolder);
            }

            //LayoutRoot.ColumnDefinitions.Add(render);
            //LayoutRoot.ColumnDefinitions.Add(blank);
            //LayoutRoot.ColumnDefinitions.Add(button);
            App.landscape = true;
            base.OnNavigatedTo(e);
            resolution_height = Application.Current.Host.Content.ActualWidth;
            resolution_width  = Application.Current.Host.Content.ActualHeight;
            screenratio       = resolution_width / resolution_height;
            if (!IsInitialized)
            {
                drawingSurfacebg         = new DrawingSurface();
                drawingSurfacebg.Loaded += drawingSurfacebg_Loaded;
                drawingSurfacebg.ManipulationStarted += drawingSurfacebg_ManipulationStarted;
                RenderArea.Children.Add(drawingSurfacebg);
                me.MediaEnded            += me_MediaEnded;
                me.ManipulationCompleted += me_ManipulationCompleted;
                exit = new Button_withText("exit", new Thickness(resolution_width - 48, resolution_height - 48, 0, 0), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                skip = new Button_withText("skip", new Thickness(resolution_width - 48, resolution_height - 96, 0, 49), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                //save = new Button_withText("save", new Thickness(resolution_width - 48, resolution_height - 144, 0, 97), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                //load = new Button_withText("load", new Thickness(resolution_width - 48, resolution_height - 192, 0, 145), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                back = new Button_withText("back", new Thickness(resolution_width - 48, resolution_height - 144, 0, 97), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                forw = new Button_withText("forw", new Thickness(resolution_width - 48, resolution_height - 192, 0, 145), new SolidColorBrush(Colors.Blue), new SolidColorBrush(Colors.White), 0.4, 0.5);
                ShowQuickButton();
                IsInitialized = true;
            }
            else
            {
                m_d3dBackground.Activated();
            }
            if (isMediaPlaying)
            {
                me.Stop();
                isMediaPlaying = false;
                LayoutRoot.Children.Remove(me);
            }
        }