Added more UI logic. Added a manga pipeline test.

This commit is contained in:
2025-06-04 02:21:30 -04:00
parent 7dbcdc6169
commit 70513559cb
21 changed files with 264 additions and 73 deletions

View File

@@ -1,62 +1,19 @@
using MangaReader.Core.Search;
using MangaReader.Core.Sources.MangaDex.Api;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Threading;
using Windows.Foundation;
using Windows.Foundation.Collections;
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.
namespace MangaReader.WinUI;
namespace MangaReader.WinUI
public sealed partial class MainWindow : Window
{
/// <summary>
/// An empty window that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class MainWindow : Window
private const string ApplicationTitle = "Manga Reader";
public MainWindow(IMangaSearchCoordinator mangaSearchCoordinator, IMangaDexClient mangaDexClient)
{
private readonly IMangaSearchCoordinator _mangaSearchCoordinator;
private readonly IMangaDexClient _mangaDexClient;
InitializeComponent();
private CancellationTokenSource? _cancellationTokenSource;
public MainWindow(IMangaSearchCoordinator mangaSearchCoordinator, IMangaDexClient mangaDexClient)
{
InitializeComponent();
_mangaSearchCoordinator = mangaSearchCoordinator;
_mangaDexClient = mangaDexClient;
}
//private async void Button_Click(object sender, RoutedEventArgs e)
//{
// if (string.IsNullOrWhiteSpace(KeywordTextBox.Text))
// return;
// _cancellationTokenSource?.Cancel();
// _cancellationTokenSource = new();
// var result = await _mangaSearchCoordinator.SearchAsync(KeywordTextBox.Text, _cancellationTokenSource.Token);
// //Guid mangaGuid = new("a920060c-7e39-4ac1-980c-f0e605a40ae4");
// //var coverArtResult = await _mangaDexClient.GetCoverArtAsync(mangaGuid, _cancellationTokenSource.Token);
// // if ( (coverArtResult is MangaDexC)
// // {
// // }
// // if (coverArtResult.)
//}
Title = ApplicationTitle;
ExtendsContentIntoTitleBar = true; // enable custom titlebar
SetTitleBar(AppTitleBar); // set user ui element as titlebar
}
}
}