public SettingsPageViewModel(INavigationService navigationService, IContext ctx, IEventAgregator eventAggregator) : base(navigationService) { _ctx = ctx; _eventAggregator = eventAggregator; _configs = new Dictionary <string, Config>(); _ctx.GetAll <Config>().ForEach(cfg => { _configs[cfg.Key] = cfg; }); NewGameCommand = new DelegateCommand(CreateNewGame); }
public MainPageViewModel(INavigationService navigationService, IContext ctx, IEventAgregator eventAggregator) : base(navigationService) { _ctx = ctx; _eventAggregator = eventAggregator; Title = "Main Page"; GameNavigationCommand = new DelegateCommand <Game>(Navigate); _eventAggregator.Subscribe <GameChangedEvent>(RefreshGames); RefreshGames(); }
public GameCreatorPageViewModel(IContext ctx, INavigationService navigationService, IEventAgregator eventAggregator) : base(navigationService) { _ctx = ctx; Title = "Game Creator"; _eventAggregator = eventAggregator; DiceList = new ObservableCollection <Dice>(); AddDiceCommand = new DelegateCommand(AddDice); EditDiceCommand = new DelegateCommand <Dice>(EditDice); DeleteDiceCommand = new DelegateCommand <Dice>(DeleteDice); SetLogoImageCommand = new DelegateCommand(SetLogoImage); Model = new Game { Id = _ctx.GetNextId <Game>(), IsEditable = true, Dice = new List <Dice>() }; }
void Awake() { EventAgregator = new EventAgregator(); Instance = this; }
public OnlyMouseView(IEventAgregator eventAgregator) { eventAgregator.Subscribe(this); }
public View(IEventAgregator eventAgregator) { eventAgregator.Subscribe(this); }