More updates.
This commit is contained in:
41
MangaReader.WinUI/Views/LibraryView.xaml
Normal file
41
MangaReader.WinUI/Views/LibraryView.xaml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<UserControl
|
||||
x:Class="MangaReader.WinUI.Views.LibraryView"
|
||||
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=LibraryViewModel}"
|
||||
d:DataContext="{d:DesignInstance Type=vm:LibraryViewModel, IsDesignTimeCreatable=True}"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<Grid Padding="0" RowSpacing="20">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="*"></RowDefinition>
|
||||
</Grid.RowDefinitions>
|
||||
<Border HorizontalAlignment="Stretch">
|
||||
<StackPanel Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center" Padding="10">
|
||||
<TextBlock Text="Library" Width="300"></TextBlock>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!--<ScrollViewer Grid.Row="1" RenderTransformOrigin=".5,.5" Padding="50">
|
||||
<ScrollViewer.RenderTransform>
|
||||
<ScaleTransform ScaleX="1" ScaleY="1" />
|
||||
</ScrollViewer.RenderTransform>
|
||||
<ItemsRepeater ItemsSource="{Binding SearchResults2, Mode=OneWay}" ItemTemplate="{StaticResource MangaSearchResultTemplate}">
|
||||
<ItemsRepeater.Layout>
|
||||
<UniformGridLayout MinRowSpacing="50" MinColumnSpacing="50" ItemsStretch="Fill" MinItemWidth="800"></UniformGridLayout>
|
||||
</ItemsRepeater.Layout>
|
||||
</ItemsRepeater>
|
||||
</ScrollViewer>-->
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
19
MangaReader.WinUI/Views/LibraryView.xaml.cs
Normal file
19
MangaReader.WinUI/Views/LibraryView.xaml.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using MangaReader.WinUI.ViewModels;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MangaReader.WinUI.Views;
|
||||
|
||||
public sealed partial class LibraryView : UserControl
|
||||
{
|
||||
private readonly LibraryViewModel viewModel;
|
||||
|
||||
public LibraryView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
viewModel = (LibraryViewModel)DataContext;
|
||||
}
|
||||
}
|
||||
@@ -34,6 +34,7 @@
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<RowDefinition Height="Auto"></RowDefinition>
|
||||
<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>
|
||||
<ItemsControl Grid.Row="1" ItemsSource="{x:Bind Genres, Mode=OneTime}" ItemTemplate="{StaticResource GenreTemplate}">
|
||||
@@ -43,10 +44,17 @@
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
<ScrollViewer Grid.Row="3">
|
||||
<ScrollViewer Grid.Row="2">
|
||||
<TextBlock Text="{x:Bind Description}" Foreground="{StaticResource TextFillColorSecondaryBrush}" FontSize="16" TextWrapping="Wrap" LineStackingStrategy="BlockLineHeight" LineHeight="22"></TextBlock>
|
||||
</ScrollViewer>
|
||||
|
||||
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button
|
||||
Content="Import"
|
||||
MinWidth="100"
|
||||
Tag="{x:Bind}"
|
||||
Click="Button_Click">
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -1,12 +1,30 @@
|
||||
using MangaReader.Core.Search;
|
||||
using MangaReader.WinUI.ViewModels;
|
||||
using Microsoft.UI.Xaml;
|
||||
using Microsoft.UI.Xaml.Controls;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MangaReader.WinUI.Views;
|
||||
|
||||
public sealed partial class SearchView : UserControl
|
||||
{
|
||||
private readonly SearchViewModel viewModel;
|
||||
|
||||
public SearchView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
viewModel = (SearchViewModel)DataContext;
|
||||
}
|
||||
|
||||
private async void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is not Button button)
|
||||
return;
|
||||
|
||||
if (button.Tag is not ObservableMangaSearchResult searchResult)
|
||||
return;
|
||||
|
||||
await viewModel.ImportAsync(searchResult, CancellationToken.None);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user