Exemplo n.º 1
0
        public void MenuPage_Loaded(object sender, RoutedEventArgs e)
        {
            MenuScreenHeaders currentHeader;

            switch (MainWindow.PreviousPageTitle)
            {
            case "Intro":
            case "TRAINING":
                currentHeader = MenuScreenHeaders.MainMenu;
                break;

            case "LOCAL":
                currentHeader = MenuScreenHeaders.Multiplayer;
                break;

            default:
                return;
            }

            Options.TitleText   = MenuScreen.GetTitleForHeader(currentHeader);
            Options.OptionNames = MenuScreen.GetOptionsForHeader(currentHeader);

            String imageName = MenuScreen.GetImageNameForHeader(currentHeader);

            MenuGrid.Background = FindResource(imageName) as ImageBrush;

            BottomBorder.BorderWidth = MenuGrid.ColumnDefinitions[1].ActualWidth;
        }
Exemplo n.º 2
0
        public void PrepareForTransition(MenuScreenHeaders currentHeader)
        {
            this.OptionDescription.Text    = "";
            MenuGrid.MouseRightButtonDown -= MenuPage_MouseRightButtonDown;

            DoubleAnimation fade = new DoubleAnimation(0.6, 0.0, TimeSpan.FromSeconds(0.3));

            fade.Completed += (s, args) =>
            {
                String imageName = MenuScreen.GetImageNameForHeader(currentHeader);
                MenuGrid.Background = FindResource(imageName) as ImageBrush;
                MenuGrid.Background.BeginAnimation(ImageBrush.OpacityProperty, new DoubleAnimation(0.0, 0.6, TimeSpan.FromSeconds(0.3)));
            };
            MenuGrid.Background.BeginAnimation(ImageBrush.OpacityProperty, fade);
        }