public MenuPageViewModel(IViewModelBaseModule baseModule, IMenuModule menuModule) : base(baseModule) { Title = "MenuPage"; _menuModule = menuModule; MenuList = new ObservableCollection <MenuItem>(); Task.Run(async() => { var user = await BaseModule.CacheEntity.GetObjectAsync <User>(AppSettings.IdAppUserCache); if (user != null) { Email = user.Email; } }); LoadMenu(); }
public SelectShipCommand(IMenuModule m, string id) { menuModule = m; this.id = id; }
public PlayCommand(IMenuModule m) { menuModule = m; }
public SelectDifficultyCommand(IMenuModule m, string id) { menuModule = m; this.id = id; }
public MenuFactory(string dirPath, IMenuModule menuModule) { this.dirPath = dirPath; this.menuModule = menuModule; menuElementFac = new MenuElementFactory(); }
public NavToCommand(IMenuModule m, string id, string parentId) { menuModule = m; this.id = id; this.parentId = parentId; }
public List <MenuElement> Create(JArray textBoxesObj, JArray buttonsObj, JArray colorsObj, IMenuModule menuModule, string parentId) { List <MenuElement> result = new List <MenuElement>(); Color hoverColor = Util.DeserializeKeyedColor(colorsObj, "hoverColor"); Color fillColor = Util.DeserializeKeyedColor(colorsObj, "fillColor"); Color borderColor = Util.DeserializeKeyedColor(colorsObj, "borderColor"); Color fontColor = Util.DeserializeKeyedColor(colorsObj, "fontColor"); foreach (JObject obj in textBoxesObj) { result.Add(CreateTextBox(obj, hoverColor, fillColor, borderColor, fontColor)); } foreach (JObject obj in buttonsObj) { result.Add(CreateButton(obj, hoverColor, fillColor, borderColor, fontColor, menuModule, parentId)); } return(result); }
/// <summary> /// built on runtime to allow the plaeyr to choose different data selections /// </summary> /// <returns></returns> public SelectButton CreateSelectButton(string id, string label, Rectangle bounds, SelectionType type, string payload, SelectionGroup parent, IMenuModule menuModule) { MenuCommandFactory menuCommandFac = new MenuCommandFactory(menuModule); ICommand command; switch (type) { case SelectionType.Difficulty: command = new SelectDifficultyCommand(menuModule, payload); break; case SelectionType.Level: command = new SelectLevelCommand(menuModule, payload); break; case SelectionType.Ship: command = new SelectShipCommand(menuModule, payload); break; default: command = null; break; } Color hover = Color.Orange; Color fill = Color.Grey; Color border = Color.White; Color font = Color.White; return(new SelectButton(id, command, bounds, hover, fill, border, font, payload, parent, type)); }
public Button CreateButton(JObject buttonObj, Color hover, Color fill, Color border, Color font, IMenuModule menuModule, string parentId) { Rectangle bounds = CreateElementBounds(buttonObj); string text = buttonObj.Value <string>("label"); string action = buttonObj.Value <string>("action"); string payload = ""; try { payload = buttonObj.Value <string>("payload"); } catch { } string id = buttonObj.Value <string>("id"); string type = buttonObj.Value <string>("type"); //build command for button MenuCommandFactory menuCommandFac = new MenuCommandFactory(menuModule); ICommand command = menuCommandFac.Create(action, payload, parentId); switch (type.ToLower()) { case "nonstick": return(new NonStickButton(id, command, bounds, hover, fill, border, font, text)); default: return(new Button(id, command, bounds, hover, fill, border, font, text)); } }
public MenuCommandFactory(IMenuModule m) { menuModule = m; }
public ExitMenuCommand(IMenuModule m) { menuModule = m; }