public void Initialize() { this.OnActualUnload(_discordPresence); if (!(DataContext is ViewModel)) { return; } InitializeComponent(); InputBindings.AddRange(new[] { new InputBinding(new DelegateCommand(() => Model.AcObject.SelectedEvent?.GoCommand.ExecuteAsync().Ignore()), new KeyGesture(Key.G, ModifierKeys.Control)), new InputBinding(new DelegateCommand(() => KunosCareer.NavigateToCareerPage(null)), new KeyGesture(Key.W, ModifierKeys.Control)), }); var acObject = Model.AcObject; if (acObject.LastSelectedTimestamp != 0) { return; } if (File.Exists(acObject.StartVideo)) { //if (VideoViewer.IsSupported()) { new VideoViewer(acObject.StartVideo, acObject.Name).ShowDialog(); //} } new KunosCareerIntro(acObject).ShowDialog(); acObject.LastSelectedTimestamp = DateTime.Now.ToMillisecondsTimestamp(); _discordPresence.LargeImage = new DiscordImage("", acObject.DisplayName); }
private void NextButton_OnMouseLeftButtonUp(object sender, MouseButtonEventArgs e) { var career = Model.AcObject.NextCareerObject; if (career == null) { return; } KunosCareer.NavigateToCareerPage(career); }
private void AcObject_AcObjectOutdated(object sender, EventArgs e) { var acObject = KunosCareerManager.Instance.GetById(Model.AcObject.Id); if (acObject == null || acObject.HasErrors || !acObject.IsAvailable) { KunosCareer.NavigateToCareerPage(null); return; } Model.AcObject.AcObjectOutdated -= AcObject_AcObjectOutdated; Model.AcObject = acObject; acObject.AcObjectOutdated += AcObject_AcObjectOutdated; }
public void Load() { UserChampionshipsManager.Instance.EnsureLoaded(); var acObject = UserChampionshipsManager.Instance.GetById(_id); if (acObject == null || acObject.HasErrors || !acObject.IsAvailable) { KunosCareer.NavigateToCareerPage(null); return; } DataContext = new ViewModel(acObject); }
private void OnOutdated() { var acObject = UserChampionshipsManager.Instance.GetById(Model.AcObject.Id); if (acObject == null || acObject.HasErrors || !acObject.IsAvailable) { KunosCareer.NavigateToCareerPage(null); return; } Model.AcObject.AcObjectOutdated -= AcObject_AcObjectOutdated; Model.AcObject = acObject; acObject.AcObjectOutdated += AcObject_AcObjectOutdated; Model.OnUnloaded(); }
public void Load() { KunosCareerManager.Instance.EnsureLoaded(); var acObject = KunosCareerManager.Instance.GetById(_id); if (acObject == null || acObject.HasErrors || !acObject.IsAvailable) { KunosCareer.NavigateToCareerPage(null); return; } acObject.EnsureEventsLoaded(); _discordPresence?.Default(acObject.DisplayName); DataContext = new ViewModel(acObject); }
public async Task LoadAsync(CancellationToken cancellationToken) { await KunosCareerManager.Instance.EnsureLoadedAsync(); var acObject = await KunosCareerManager.Instance.GetByIdAsync(_id); if (acObject == null || acObject.HasErrors || !acObject.IsAvailable) { KunosCareer.NavigateToCareerPage(null); return; } await acObject.EnsureEventsLoadedAsync(); DataContext = new ViewModel(acObject); }