[SuppressMessage("ReSharper", "SuggestBaseTypeForParameter")]// needed for DI public MainViewModel( Configuration config, ShortcutManager shortcutManager, // manually injecting all tabs for now, SourcesViewModel sourcesVm, // might want to replace this if more tabs get added ConfigurationViewModel configuration, DownloaderViewModel downloader, LibraryViewModel library) { DisplayName = WindowTitleBase; TabClosing = OnTabClosing; this.config = config; this.shortcutManager = shortcutManager; CreateShortcuts(); Items.AddRange(new TabViewModelBase[] { library, downloader, sourcesVm, configuration, }); library.ConductWith(this); downloader.ConductWith(this); sourcesVm.ConductWith(this); configuration.ConductWith(this); var tabId = config.State.ActiveTab ?? string.Empty; var tab = Items.FirstOrDefault(t => t.Id == tabId); if (tab != null) { ActivateItem(tab); } }
public IActionResult Index() { var model = new SourcesViewModel(); model.M3USources = defaultContext.M3USources.OrderBy(s => s.Name).ToList(); return(View(model)); }
private static bool CompareSourcesIds(SourcesViewModel viewModel, SourcesDto dtoModel) { if (viewModel.PostId != dtoModel.PostId || viewModel.EventId != dtoModel.EventId || viewModel.ProjectId != dtoModel.ProjectId || viewModel.WallId != dtoModel.WallId) { return(false); } return(true); }
private void CreateViewModels() { StationsViewModel = new StationsViewModel(_settings); SourcesViewModel = new SourcesViewModel(_settings); ForecastViewer = new ForecastViewerViewModel(_settings); AccuracyViewModel = new AccuracyViewModel(_settings); PageViewModels.Add(AccuracyViewModel); PageViewModels.Add(SourcesViewModel); PageViewModels.Add(ForecastViewer); }
public TotalsViewModel(int leadsTotal, int opportunitiesTotal, int quotesTotal, int invoicesTotal, int conversionsTotal, int ordersTotal, double revenueTotal, SourcesViewModel sourcesTotal) { LeadsTotal = leadsTotal; OpportunitiesTotal = opportunitiesTotal; QuotesTotal = quotesTotal; InvoicesTotal = invoicesTotal; ConversionsTotal = conversionsTotal; OrdersTotal = ordersTotal; RevenueTotal = revenueTotal; SourcesTotal = sourcesTotal; }
public ActionResult Index() { var upcomingSoucres = _dbContext.Courses .Include(c => c.Lecturer) .Include(c => c.Category) .Where(c => c.Datetime > DateTime.Now); var viewModel = new SourcesViewModel { UpcomingSources = upcomingSoucres, ShowAction = User.Identity.IsAuthenticated }; return(View(viewModel)); }
public ActionResult Edit(int id) { var userId = User.Identity.GetUserId(); var source = _dbContext.sources.Single(c => c.Id == id && c.LecturerId == userId); var viewModel = new SourcesViewModel { Categories = _dbContext.Categories.ToList(), Date = source.DateTime.ToString("dd/M/yyyy"), Time = source.DateTime.ToString("HH:mm"), Category = source.CategoryId, Place = source.Place }; return(View("Create", viewModel)); }
public ActionResult Attending() { var userId = User.Identity.GetUserId(); var sources = _dbContext.Attendances .Where(a => a.AttendeeId == userId) .Select(a => a.Source) .Include(l => l.Lecturer) .Include(l => l.Category) .ToList(); var viewModel = new SourcesViewModel { UpcomingSources = sources, ShowAction = User.Identity.IsAuthenticated }; return(View(viewModel)); }
public PlayerBuildModel(PlayerModel parent) : base(parent.Context) { Parent = parent; ChildModel = true; PlayerChanged += PlayerBuildModel_PlayerChanged; Undo = Parent.Undo; Redo = Parent.Redo; race = new RaceViewModel(this); classes = new ClassesViewModel(this); background = new BackgroundViewModel(this); playerInventory = new PlayerInventoryViewModel(this); playerShops = new PlayerShopViewModel(this); playerInventoryChoices = new PlayerInventoryChoicesViewModel(this); playerScores = new PlayerScoresViewModel(this); playerPersonal = new PlayerPersonalViewModel(this); playerJournal = new PlayerJournalViewModel(this); playerFeatures = new PlayerFeaturesViewModel(this); playerSources = new SourcesViewModel(this); playerInfo = new PlayerInfoViewModel(this); UpdateSpellcasting(); }
public PlayerBuildModel(BuilderContext context) : base(context) { PlayerChanged += PlayerBuildModel_PlayerChanged; Context.HistoryButtonChange += Player_HistoryButtonChange; Context.SourcesChangedEvent += Context_SourcesChangedEvent; Undo = new Command(() => { Context.Undo(); FirePlayerChanged(); Save(); }, () => { return(Context.CanUndo()); }); Redo = new Command(() => { Context.Redo(); FirePlayerChanged(); Save(); }, () => { return(Context.CanRedo()); }); race = new RaceViewModel(this); classes = new ClassesViewModel(this); background = new BackgroundViewModel(this); playerInventory = new PlayerInventoryViewModel(this); playerShops = new PlayerShopViewModel(this); playerInventoryChoices = new PlayerInventoryChoicesViewModel(this); playerScores = new PlayerScoresViewModel(this); playerPersonal = new PlayerPersonalViewModel(this); playerJournal = new PlayerJournalViewModel(this); playerFeatures = new PlayerFeaturesViewModel(this); playerSources = new SourcesViewModel(this); playerInfo = new PlayerInfoViewModel(this); play = new SwitchToPlayModel(this); UpdateFormModels(); UpdateSpellcasting(); }
public SourcesView(SourcesViewModel vm) : base(vm) { InitializeComponent(); }
public SourcesPage(SourcesViewModel model) { model.Navigation = Navigation; BindingContext = model; InitializeComponent(); }