WIn_RustTools/RustTools/Views/HomePage.xaml

115 lines
4.7 KiB
Plaintext
Raw Normal View History

2024-07-19 07:36:44 +00:00
<?xml version="1.0" encoding="utf-8" ?>
2024-07-14 11:24:10 +00:00
<Page
x:Class="RustTools.Views.HomePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:data="using:RustTools.DataList"
2024-07-19 07:36:44 +00:00
xmlns:local="using:RustTools.Views"
xmlns:local1="using:Windows.ApplicationModel.Contacts"
2024-07-14 11:24:10 +00:00
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2024-07-23 12:23:55 +00:00
SizeChanged="Page_SizeChanged"
2024-07-19 07:36:44 +00:00
mc:Ignorable="d">
2024-07-23 12:23:55 +00:00
<Page.Resources>
<DataTemplate x:Key="HomePageListItem" x:DataType="local:HomePage">
<StackPanel Orientation="Horizontal">
<Border
Width="56"
Height="56"
BorderBrush="White"
BorderThickness="0"
CornerRadius="9">
<Border.Background>
<ImageBrush ImageSource="{Binding Icon}" Stretch="UniformToFill" />
2024-07-23 12:23:55 +00:00
</Border.Background>
</Border>
<StackPanel Margin="10,10,10,10" Orientation="Vertical">
<TextBlock Style="{StaticResource SubtitleTextBlockStyle}" Text="{Binding Name}" />
2024-07-23 12:23:55 +00:00
<TextBlock
Width="500"
MaxLines="2"
Style="{StaticResource BodyStrongTextBlockStyle}"
Text="{Binding Description}"
2024-07-23 12:23:55 +00:00
TextTrimming="CharacterEllipsis"
TextWrapping="Wrap" />
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="{Binding UpdateTime}" />
<TextBlock
Margin="10,0,0,0"
Style="{StaticResource BodyTextBlockStyle}"
Text="{Binding CoinNumber}" />
<TextBlock Style="{StaticResource BodyTextBlockStyle}" Text="次下载" />
</StackPanel>
2024-07-23 12:23:55 +00:00
</StackPanel>
2024-07-19 07:36:44 +00:00
2024-07-23 12:23:55 +00:00
</StackPanel>
</DataTemplate>
</Page.Resources>
2024-07-23 12:23:55 +00:00
<ScrollView HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden">
2024-07-19 07:36:44 +00:00
<StackPanel Orientation="Vertical">
<FlipView
2024-07-23 12:23:55 +00:00
x:Name="Banner"
Height="360"
2024-07-19 07:36:44 +00:00
ItemsSource="{x:Bind Pictures}">
<FlipView.ItemTemplate>
<DataTemplate x:DataType="data:HomeBanner">
2024-07-23 12:23:55 +00:00
<Image
HorizontalAlignment="Center"
VerticalAlignment="Center"
PointerPressed="Image_PointerPressed"
Source="{Binding picture}"
2024-07-23 12:23:55 +00:00
Stretch="UniformToFill" />
2024-07-19 07:36:44 +00:00
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
<PipsPager
x:Name="FlipViewPipsPager"
Margin="0,12,0,0"
HorizontalAlignment="Center"
NumberOfPages="{x:Bind Pictures.Count}"
2024-07-23 12:23:55 +00:00
SelectedPageIndex="{x:Bind Path=Banner.SelectedIndex, Mode=TwoWay}" />
2024-07-14 11:24:10 +00:00
2024-07-19 07:36:44 +00:00
<RelativePanel>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="随机推荐" />
<AppBarButton
Click="RefreshRandom"
2024-07-19 07:36:44 +00:00
Icon="Refresh"
Label="刷新"
RelativePanel.AlignRightWithPanel="True" />
</RelativePanel>
2024-07-23 12:23:55 +00:00
2024-07-19 07:36:44 +00:00
<ListView
2024-07-19 14:29:49 +00:00
x:Name="list"
2024-07-23 12:23:55 +00:00
HorizontalAlignment="Stretch"
2024-07-19 07:36:44 +00:00
IsItemClickEnabled="True"
2024-07-23 12:23:55 +00:00
ItemClick="ListAClick"
ItemTemplate="{StaticResource HomePageListItem}"
ItemsSource="{x:Bind ViewModel.randomList}"
2024-07-23 12:23:55 +00:00
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="None" />
2024-07-14 11:24:10 +00:00
2024-07-19 07:36:44 +00:00
<RelativePanel>
<TextBlock Style="{StaticResource TitleTextBlockStyle}" Text="最新发布" />
<AppBarButton
Click="RefreshLatest"
2024-07-19 07:36:44 +00:00
Icon="Refresh"
Label="刷新"
RelativePanel.AlignRightWithPanel="True" />
</RelativePanel>
<ListView
Grid.Row="2"
2024-07-23 12:23:55 +00:00
Margin="0,0,0,50"
2024-07-19 07:36:44 +00:00
IsItemClickEnabled="True"
ItemClick="ListAClick"
2024-07-23 12:23:55 +00:00
ItemTemplate="{StaticResource HomePageListItem}"
ItemsSource="{x:Bind ViewModel.latestTimeList}"
2024-07-19 07:36:44 +00:00
SelectionMode="None" />
2024-07-23 12:23:55 +00:00
2024-07-19 07:36:44 +00:00
</StackPanel>
2024-07-23 12:23:55 +00:00
2024-07-19 07:36:44 +00:00
</ScrollView>
2024-07-23 12:23:55 +00:00
2024-07-14 11:24:10 +00:00
</Page>