private void UpdateTitleLinks() { var value = AppAppearanceManager.Instance.DownloadsInSeparatePage; DownloadsEntry.IsAvailable = value; BrowserLinkGroup.GroupKey = value ? @"downloads" : @"content"; TitleLinks.OfType <TitleLink>().Where(x => x.GroupKey != null) .ForEach(x => x.IsShown = AppAppearanceManager.Instance.IsTitleLinkVisible(x.GroupKey) != false); AppAppearanceManager.Instance.TitleLinkEntries.ForEach(x => x.PropertyChanged += OnTitleLinkEnabledChanged); }
private void OnTitleLinkEnabledChanged(object o, PropertyChangedEventArgs args) { var entry = (TitleLinkEnabledEntry)o; var link = TitleLinks.OfType <TitleLink>().FirstOrDefault(x => x.GroupKey == entry.Id); if (link != null) { link.IsShown = entry.IsEnabled && entry.IsAvailable; } }
private void OnFrameNavigated(object sender, NavigationEventArgs navigationEventArgs) { FrameNavigated?.Invoke(this, navigationEventArgs); var activeKey = _menu?.SelectedLinkGroup?.GroupKey; foreach (var link in TitleLinks.OfType <TitleLink>()) { link.IsActive = link.GroupKey == activeKey; } }