Ejemplo n.º 1
0
 public void Setup()
 {
     mainWindow           = new MainWindow();
     currDataContext      = mainWindow.DataContext as StartMenuViewModel;
     startMenuDataContext = currDataContext as StartMenuViewModel;
     gameDataContext      = null;
 }
Ejemplo n.º 2
0
        private void InitializeComponent()
        {
            var viewmodel = new StartMenuViewModel();
            var view      = new StartMenu(viewmodel);

            view.Show();
        }
Ejemplo n.º 3
0
        public Juego()
        {
            InitializeComponent();
            DataContext = new StartMenuViewModel(this);
            var startMenu = DataContext as StartMenuViewModel;

            startMenu.StartNewGame((int)SlideCategories.Animals);
        }
Ejemplo n.º 4
0
 public void Setup()
 {
     mainWindow           = new MainWindow();
     currDataContext      = mainWindow.DataContext as StartMenuViewModel;
     startMenuDataContext = currDataContext as StartMenuViewModel;
     slideCollection      = new SlideCollectionViewModel();
     gameDataContext      = null;
 }
Ejemplo n.º 5
0
        public StartMenu()
        {
            InitializeComponent();

            NavigationPage.SetHasNavigationBar(this, false);

            BindingContext = new StartMenuViewModel(Navigation);
        }
        public void SetUp()
        {
            _mockCommandBus    = new Mock <ICommandBus>();
            _mockDialogService = new Mock <IDialogService>();

            _viewModel = new StartMenuViewModel(
                _mockCommandBus.Object,
                _mockDialogService.Object);
        }
Ejemplo n.º 7
0
        public void Initialization_Registers_WithSearchController()
        {
            // Arrange
            var searchController = new Mock <ISearchController <IStartMenuAction> >();

            // Act
            var vm = new StartMenuViewModel(searchController.Object);

            // Assert
            searchController.Verify(m => m.Register(vm, "Query"), Times.Once, "The start menu view model must register with the search.");
        }
Ejemplo n.º 8
0
        /// <summary>
        /// インスタンスを生成します。
        /// </summary>
        /// <param name="screen">Screen。</param>
        public StartMenuWindow(Screen screen)
            : base(screen)
        {
            viewModel   = new StartMenuViewModel(screen.Game);
            DataContext = viewModel;

            Width        = 320;
            ShadowOffset = new Vector2(4);
            Padding      = new Thickness(16);

            var stackPanel = new StackPanel(screen)
            {
                Orientation         = Orientation.Vertical,
                HorizontalAlignment = HorizontalAlignment.Stretch
            };

            Content = stackPanel;

            var startButton = ControlUtil.CreateDefaultMenuButton(screen, Strings.StartButton);

            startButton.Click += OnStartButtonClick;
            stackPanel.Children.Add(startButton);

            var selectLanguageButton = ControlUtil.CreateDefaultMenuButton(screen, Strings.SelectLanguageButton);

            selectLanguageButton.Click += OnLanguageSettingButtonClick;
            stackPanel.Children.Add(selectLanguageButton);

            var installDemoBlocksButton = ControlUtil.CreateDefaultMenuButton(screen, Strings.InstallDemoBlocksButton);

            installDemoBlocksButton.Click += OnInstallDemoBlocksButtonClick;
            stackPanel.Children.Add(installDemoBlocksButton);

            var uploadDemoBlocksButton = ControlUtil.CreateDefaultMenuButton(screen, Strings.UploadDemoBlocksButton);

            uploadDemoBlocksButton.Enabled = viewModel.BoxIntegrationEnabled;
            uploadDemoBlocksButton.Click  += OnUploadDemoBlocksButtonClick;
            stackPanel.Children.Add(uploadDemoBlocksButton);

            changeLookAndFeelButton        = ControlUtil.CreateDefaultMenuButton(screen, "Look & Feel [Debug]");
            changeLookAndFeelButton.Click += OnChangeLookAndFeelButtonClick;
            stackPanel.Children.Add(changeLookAndFeelButton);

            var exitButton = ControlUtil.CreateDefaultMenuButton(screen, Strings.ExitButton);

            exitButton.Click += OnExitButtonClick;
            stackPanel.Children.Add(exitButton);

            // デフォルト フォーカス。
            startButton.Focus();
        }
Ejemplo n.º 9
0
        public MainWindow()
        {
            InitializeComponent();
            flightSimulatorModel = new MyFlightSimulatorModel(new MyTelnetClient());

            dataDisplayViewModel             = new DataDisplayViewModel(flightSimulatorModel);
            dataDisplayControl.DataDisplayVM = dataDisplayViewModel;

            graphViewModel       = new GraphViewModel(flightSimulatorModel);
            graphControl.GraphVM = graphViewModel;

            joystickViewModel          = new JoystickViewModel(flightSimulatorModel);
            joystickControl.JoystickVM = joystickViewModel;

            mediaViewModel            = new MediaViewModel(flightSimulatorModel);
            mediaPanelControl.MediaVM = mediaViewModel;

            startMenuViewModel           = new StartMenuViewModel(flightSimulatorModel);
            startMenuControl.StartMenuVM = startMenuViewModel;
        }
Ejemplo n.º 10
0
 public MemoryGame()
 {
     InitializeComponent();
     DataContext = new StartMenuViewModel(this);
 }
Ejemplo n.º 11
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext = new StartMenuViewModel(this);
 }