public GameModesPageViewModel(UserInteractionService userInteractionService, MenuGameModeItem[] gameModeItems)
        {
            _userInteractionService = userInteractionService;
            _gameModeItems = gameModeItems;
            InitializeComponent();

            gameModePage_listBox.ItemsSource = gameModeItems;
            gameModePage_listBox.SelectionChanged += OnGameModeItemClick;
        }
示例#2
0
        public MenuGameModeItem[] GetMenuGameModeItems()
        {
            MenuGameModeItem[] items = null;

            string[] modeDirs = Directory.GetDirectories(challengesDirPath);
            items = new MenuGameModeItem[modeDirs.Count()];

            for (int i = 0; i < items.Count(); i++)
            {
                items[i] = new MenuGameModeItem();
                items[i].Id = int.Parse(modeDirs[i].Split('_').LastOrDefault());
                items[i].GameModeId = items[i].Id;
                items[i].BoxItems = GetMenuBoxItems(items[i].Id, modeDirs[i]);
                items[i].ImageSource = new BitmapImage(new System.Uri(modeDirs[i] + @"/modeButton.png"));
            }

            return items;
        }
 public UserInteractionService(InteractionWindowViewModel parentWindow, MenuGameModeItem[] gameModeItems)
 {
     _parentWindow = parentWindow;
     _gameModeItems = gameModeItems;
 }