Restrcutured the database, and updated pipeline to include cover art.

This commit is contained in:
2025-10-14 00:06:31 -04:00
parent 33e521e8bb
commit 4797d3c559
29 changed files with 488 additions and 95 deletions

View File

@@ -0,0 +1,50 @@
using MangaReader.WinUI.ViewModels;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Media.Animation;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace MangaReader.WinUI.Views;
public sealed partial class MainView : UserControl
{
private readonly MainViewModel viewModel;
private readonly List<(string Tag, Type ViewType)> _tagViewMap =
[
("Search", typeof(SearchView)),
("Library", typeof(LibraryView))
];
public MainView()
{
InitializeComponent();
viewModel = (MainViewModel)DataContext;
}
private void nvSample_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
if (args.SelectedItem is not NavigationViewItem navigationViewItem)
return;
if (navigationViewItem.Tag is not string tagName)
return;
UpdateContent(tagName, null);
}
private void UpdateContent(string tag, NavigationTransitionInfo? transitionInfo)
{
Type? viewType = _tagViewMap.FirstOrDefault(x => x.Tag == tag).ViewType;
if (viewType == null)
return;
ContentFrame.Navigate(viewType);
}
}