Restrcutured the database, and updated pipeline to include cover art.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UserControl
|
||||
<Page
|
||||
x:Class="MangaReader.WinUI.Views.LibraryView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -38,4 +38,4 @@
|
||||
</ScrollViewer>-->
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</Page>
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MangaReader.WinUI.Views;
|
||||
|
||||
public sealed partial class LibraryView : UserControl
|
||||
public sealed partial class LibraryView : Page
|
||||
{
|
||||
private readonly LibraryViewModel viewModel;
|
||||
|
||||
|
||||
26
MangaReader.WinUI/Views/MainView.xaml
Normal file
26
MangaReader.WinUI/Views/MainView.xaml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UserControl
|
||||
x:Class="MangaReader.WinUI.Views.MainView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="using:MangaReader.WinUI.Views"
|
||||
xmlns:vm="using:MangaReader.WinUI.ViewModels"
|
||||
xmlns:search="using:MangaReader.Core.Search"
|
||||
xmlns:UI="using:CommunityToolkit.WinUI"
|
||||
xmlns:Controls="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:Media="using:CommunityToolkit.WinUI.Media"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=MainViewModel}"
|
||||
d:DataContext="{d:DesignInstance Type=vm:MainViewModel, IsDesignTimeCreatable=True}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<NavigationView IsBackEnabled="False" IsBackButtonVisible="Collapsed" SelectionChanged="nvSample_SelectionChanged">
|
||||
<NavigationView.MenuItems>
|
||||
<NavigationViewItem Icon="Library" Content="Library" Tag="Library" />
|
||||
<NavigationViewItem Icon="Find" Content="Search" Tag="Search" />
|
||||
</NavigationView.MenuItems>
|
||||
<Frame x:Name="ContentFrame"/>
|
||||
</NavigationView>
|
||||
|
||||
</UserControl>
|
||||
50
MangaReader.WinUI/Views/MainView.xaml.cs
Normal file
50
MangaReader.WinUI/Views/MainView.xaml.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UserControl
|
||||
<Page
|
||||
x:Class="MangaReader.WinUI.Views.SearchView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
@@ -14,7 +14,7 @@
|
||||
DataContext="{Binding Source={StaticResource Locator}, Path=SearchViewModel}"
|
||||
d:DataContext="{d:DesignInstance Type=vm:SearchViewModel, IsDesignTimeCreatable=True}"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<Page.Resources>
|
||||
<Media:AttachedCardShadow x:Key="CommonShadow" Offset="5" BlurRadius="10" Opacity=".4" />
|
||||
|
||||
<DataTemplate x:Key="MangaSearchResultTemplate" x:DataType="vm:ObservableMangaSearchResult">
|
||||
@@ -36,7 +36,9 @@
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Text="{x:Bind Title, Mode=OneTime}" FontSize="24" FontFamily="{StaticResource PoppinsSemiBold}" TextWrapping="Wrap"></TextBlock>
|
||||
<Border>
|
||||
<TextBlock Grid.Row="0" Text="{x:Bind Title, Mode=OneTime}" FontSize="24" FontFamily="{StaticResource PoppinsSemiBold}" TextWrapping="Wrap"></TextBlock>
|
||||
</Border>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{x:Bind Genres, Mode=OneTime}" ItemTemplate="{StaticResource GenreTemplate}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@@ -65,7 +67,7 @@
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
</UserControl.Resources>
|
||||
</Page.Resources>
|
||||
<Grid Padding="0" RowSpacing="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
@@ -90,4 +92,4 @@
|
||||
</ScrollViewer>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
</Page>
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MangaReader.WinUI.Views;
|
||||
|
||||
public sealed partial class SearchView : UserControl
|
||||
public sealed partial class SearchView : Page
|
||||
{
|
||||
private readonly SearchViewModel viewModel;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user