public LadderUserControl(StrategyGameViewModel vm_) { InitializeComponent(); vm = vm_; listView.DataContext = vm; listView.ItemsSource= vm.ladder; }
public GameUserControl(StrategyGameViewModel vm_) { InitializeComponent(); vm=vm_; //vm.gm.statusBarTextBlock = statesBarText; //gameTable.DataContext = vm; drawMap(); }
public GameStartOptionsUserControl(StrategyGameViewModel vm_) { InitializeComponent(); vm = vm_; Player1Race.ItemsSource = Enum.GetValues(typeof(RaceType)) .Cast<RaceType>() .Select(p => new { Value = p.ToString() }) .ToList(); Player1Race.DisplayMemberPath = "Value"; Player1Race.SelectedIndex = 1; Player2Race.ItemsSource = Enum.GetValues(typeof(RaceType)) .Cast<RaceType>() .Select(p => new {Value = p.ToString() }) .ToList(); Player2Race.DisplayMemberPath = "Value"; Player2Race.SelectedIndex = 1; }
public MainWindow() { InitializeComponent(); vm = new StrategyGameViewModel(); mainMenu= new MainMenuUserControl(); mainMenu.MainMenuButtonClickedEvent += new MainMenuUserControl.ButtonClickEventHandler(selectFromMainMenu); gameStartOptions = new GameStartOptionsUserControl(vm); gameStartOptions.GameStartOptionsButtonClickedEvent += new GameStartOptionsUserControl.ButtonClickEventHandler(selectGameStartOption); ladder = new LadderUserControl(vm); ladder.BackToMainMenuButtonClickedEvent += new EventHandler(backToMainMenu); game = new GameUserControl(vm); game.BackToMainMenuButtonClickedEvent += new EventHandler(backToMainMenu); mainControlArea.Content = mainMenu; }