Example #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Main game = new Main())
     {
         game.Run();
     }
 }
Example #2
0
        public Main() {
            //Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "cs";
            this.InitializeComponent();
            instance = this;

            var titleBar = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;
            // Title bar colors. Alpha must be 255.
            titleBar.BackgroundColor = new Color() { A = 255, R = 60, G = 120, B = 240 };
            titleBar.ForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };
            titleBar.InactiveBackgroundColor = new Color() { A = 255, R = 60, G = 120, B = 240 };
            titleBar.InactiveForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };

            // Title bar button background colors. Alpha is respected when the view is extended
            // into the title bar (see scenario 2). Otherwise, Alpha is ignored and treated as if it were 255.
            titleBar.ButtonBackgroundColor = new Color() { A = 255, R = 60, G = 120, B = 240 };
            titleBar.ButtonHoverBackgroundColor = new Color() { A = 255, R = 50, G = 100, B = 200 };
            titleBar.ButtonPressedBackgroundColor = new Color() { A = 255, R = 232, G = 211, B = 162 };
            titleBar.ButtonInactiveBackgroundColor = new Color() { A = 255, R = 60, G = 120, B = 240 };


            // Title bar button foreground colors. Alpha must be 255.
            titleBar.ButtonForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };
            titleBar.ButtonHoverForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };
            titleBar.ButtonPressedForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };
            titleBar.ButtonInactiveForegroundColor = new Color() { A = 255, R = 220, G = 220, B = 255 };

            SystemNavigationManager.GetForCurrentView().BackRequested += (sender, args) => {
                if (canGoBack) {
                    FrameContent.GoBack();
                }
            };

            ResourceLoader resourceLoader = new ResourceLoader();
            foreach (var link in _navLinks)
                link.Label = resourceLoader.GetString(link.Label);

            foreach (var link in _displayStyles)
                link.Label = resourceLoader.GetString(link.Label);

            InitializeAfterDataLoad();          
        }