VPet/VPet-Simulator.Windows/WinDesign/winBetterBuy.xaml

258 lines
18 KiB
Plaintext
Raw Normal View History

2023-06-05 08:42:20 +00:00
<pu:WindowX x:Class="VPet_Simulator.Windows.winBetterBuy"
2023-06-08 08:46:53 +00:00
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:pu="https://opensource.panuon.com/wpf-ui" xmlns:local="clr-namespace:VPet_Simulator.Windows"
mc:Ignorable="d" Title="更好买" Height="500" Width="800" FontSize="14" WindowStartupLocation="CenterScreen"
2023-06-08 08:46:53 +00:00
Background="#E0F6FF" pu:WindowXCaption.Height="45" pu:WindowXCaption.Background="{DynamicResource DARKPrimary}"
2023-06-08 21:20:40 +00:00
pu:WindowXCaption.Foreground="#FFFFFF" pu:WindowXCaption.Buttons="Close" Icon="/Res/BetterBuy.png"
2023-06-08 08:46:53 +00:00
pu:WindowXCaption.ShadowColor="{DynamicResource ShadowColor}" Closing="WindowX_Closing">
2023-06-05 08:42:20 +00:00
<pu:WindowXCaption.CloseButtonStyle>
2023-06-08 08:46:53 +00:00
<Style TargetType="Button" BasedOn="{StaticResource {x:Static pu:WindowXCaption.CloseButtonStyleKey}}">
<Setter Property="Width" Value="28" />
<Setter Property="Height" Value="28" />
<Setter Property="Margin" Value="0,0,7,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="pu:ButtonHelper.CornerRadius" Value="14" />
<Setter Property="pu:ButtonHelper.HoverBackground" Value="White" />
<Setter Property="pu:ButtonHelper.ClickBackground" Value="{x:Null}" />
<Setter Property="pu:ButtonHelper.HoverForeground" Value="{DynamicResource DARKPrimary}" />
2023-06-05 08:42:20 +00:00
</Style>
</pu:WindowXCaption.CloseButtonStyle>
<pu:WindowXCaption.HeaderTemplate>
<DataTemplate>
<Grid Margin="10,0">
<StackPanel Orientation="Horizontal">
2023-06-08 21:20:40 +00:00
<Image x:Name="ImageWHY" Width="28" Height="28" Source="/Res/BetterBuy.png"
VerticalAlignment="Center" Margin="30,0,0,0" />
2023-06-08 08:46:53 +00:00
<Button Style="{DynamicResource TextButtonStyle}" Foreground="{DynamicResource DARKPrimaryText}"
2023-06-08 11:44:41 +00:00
Content="更好买" VerticalAlignment="Center" FontSize="20" Click="BtnTitle_Click"
pu:WindowX.IsDragMoveArea="False" Margin="10,0,0,0" />
<Grid Grid.Column="1" Margin="15,0,0,0" pu:WindowX.IsDragMoveArea="False" Width="200">
2023-06-05 08:42:20 +00:00
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
2023-06-08 08:46:53 +00:00
<TextBox x:Name="TbTitleSearch" Grid.ColumnSpan="2" VerticalAlignment="Center" Padding="7,0"
pu:TextBoxHelper.Watermark="搜索商品" FontSize="14" Background="#33FFFFFF" Height="30"
BorderThickness="0" pu:TextBoxHelper.CornerRadius="5" Loaded="TbTitleSearch_Loaded"
Foreground="{DynamicResource DARKPrimaryText}" />
<Button Grid.Column="1" Margin="0,0,3,0" VerticalAlignment="Center" Height="28" Width="28"
2023-06-05 08:42:20 +00:00
IsDefault="{Binding IsKeyboardFocusWithin, ElementName=TbTitleSearch}"
2023-06-08 08:46:53 +00:00
BorderThickness="0" pu:ButtonHelper.CornerRadius="0,5,5,0" Background="Transparent"
FontFamily="pack://application:,,,/Res/#remixicon" Content="&#xF0D1;" Padding="0"
Foreground="{DynamicResource DARKPrimaryText}" FontSize="16" Cursor="Hand"
2023-06-05 08:42:20 +00:00
Click="BtnSearch_Click" />
</Grid>
</StackPanel>
<pu:Switch Content="购买后不自动关闭窗口" Grid.Column="2" FontSize="14" Margin="10,0,5,0" Height="20"
VerticalAlignment="Center" HorizontalAlignment="Right" BoxHeight="14" ToggleSize="18"
CheckedBackground="{DynamicResource Primary}" CheckedBorderBrush="{DynamicResource Primary}"
Background="Transparent" ToggleShadowColor="{x:Null}" IsChecked="{Binding StateOpen}"
CheckedToggleBrush="{DynamicResource DARKPrimaryText}"
ToggleBrush="{DynamicResource PrimaryDark}" pu:WindowX.IsDragMoveArea="False" BoxWidth="30"
Loaded="Switch_Loaded" Checked="Switch_Checked" Unchecked="Switch_Checked" />
2023-06-05 08:42:20 +00:00
</Grid>
</DataTemplate>
</pu:WindowXCaption.HeaderTemplate>
<Window.Resources>
<local:BoolToIntConverter x:Key="BoolToIntConverter" />
<local:DiscountPriceConverter x:Key="DiscountPriceConverter" />
<DataTemplate x:Key="CommodityDataTemplate">
<Grid>
2023-06-08 08:46:53 +00:00
<pu:CarouselPanel Grid.Column="1" Animation="Fade,Flow" AnimationDuration="0:0:0.3"
CurrentIndex="{Binding IsChecked, Converter={StaticResource BoolToIntConverter}, ElementName=TbtnDetail}">
<Border Background="{DynamicResource SecondaryTrans4}" CornerRadius="5">
2023-06-05 08:42:20 +00:00
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
2023-06-08 08:46:53 +00:00
<Border Margin="25,0,0,0" Width="{Binding ActualHeight, ElementName=BdrImage}" />
<TextBlock Grid.ColumnSpan="2" Margin="10,7,0,0" FontWeight="Bold"
TextTrimming="CharacterEllipsis" FontSize="18" Text="{Binding Name}" />
<Grid Grid.Column="1" Margin="0,40,0,10">
2023-06-05 08:42:20 +00:00
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
2023-06-08 08:46:53 +00:00
<StackPanel Grid.Row="1" Orientation="Horizontal">
<TextBlock x:Name="TxtPrice" VerticalAlignment="Bottom"
Text="{Binding Price, StringFormat='$ 0.0'}" FontWeight="Bold" FontSize="18"
2023-06-08 08:46:53 +00:00
Foreground="{DynamicResource DARKPrimary}" />
<!--<TextBlock x:Name="TxtDiscountPrice" Margin="5,0,0,0" FontWeight="Bold"
FontSize="18" Foreground="{DynamicResource DARKPrimary}">
2023-06-05 08:42:20 +00:00
<TextBlock.Text>
<MultiBinding Converter="{StaticResource DiscountPriceConverter}">
<Binding Path="Price" />
<Binding Path="Discount" />
</MultiBinding>
</TextBlock.Text>
2023-06-08 08:46:53 +00:00
</TextBlock>-->
2023-06-05 08:42:20 +00:00
</StackPanel>
2023-06-08 08:46:53 +00:00
<!--<Border Grid.Row="3" Margin="0,5,0,0" HorizontalAlignment="Left"
Background="{DynamicResource SecondaryTrans}" CornerRadius="2">
2023-06-05 08:42:20 +00:00
<StackPanel Orientation="Horizontal">
2023-06-08 08:46:53 +00:00
<RepeatButton VerticalAlignment="Center" Content="-" Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnDecrease_Click" />
<TextBox Grid.Column="1" Cursor="IBeam" Background="#CDFFFFFF"
BorderThickness="0" HorizontalContentAlignment="Center"
Text="{Binding Quantity}" MinWidth="30" />
<RepeatButton Grid.Column="2" VerticalAlignment="Center" Content="+"
Padding="0,0,0,5"
Style="{DynamicResource IconInvertedForegroundRepeatButtonStyle}"
Click="RbtnIncrease_Click" />
2023-06-05 08:42:20 +00:00
</StackPanel>
2023-06-08 08:46:53 +00:00
</Border>-->
<Button Grid.Row="4" Margin="0,7,0,0" Padding="7,5" Cursor="Hand"
2023-06-08 21:06:46 +00:00
HorizontalAlignment="Left" pu:ButtonHelper.Icon="&#xF11A;"
2023-06-08 08:46:53 +00:00
Style="{DynamicResource ThemedButtonStyle}" Content="购买" Click="BtnBuy_Click" />
2023-06-05 08:42:20 +00:00
</Grid>
</Grid>
</Border>
2023-06-08 08:46:53 +00:00
<Border Background="{DynamicResource DARKPrimary}" CornerRadius="5">
2023-06-05 08:42:20 +00:00
<Grid>
2023-06-08 08:46:53 +00:00
<Grid Grid.Column="1" Margin="10,10,10,0">
2023-06-05 08:42:20 +00:00
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
2023-06-08 08:46:53 +00:00
<TextBlock VerticalAlignment="Center" TextTrimming="CharacterEllipsis" FontSize="16"
Foreground="{DynamicResource DARKPrimaryText}" Text="{Binding Name}" />
<ScrollViewer Grid.Row="1" Grid.RowSpan="4" Margin="0,7,0,0"
pu:ScrollBarHelper.ThumbBackground="#44FFFFFF"
2023-06-08 21:06:46 +00:00
PreviewMouseWheel="ScrollViewer_PreviewMouseWheel"
2023-06-08 08:46:53 +00:00
pu:ScrollBarHelper.HoverThumbBackground="#88FFFFFF">
<TextBlock TextWrapping="Wrap" Background="Transparent" FontSize="12" Padding="0"
Foreground="{DynamicResource DARKPrimaryText}" Text="{Binding Description}" />
2023-06-05 08:48:06 +00:00
</ScrollViewer>
2023-06-05 08:42:20 +00:00
</Grid>
</Grid>
</Border>
</pu:CarouselPanel>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
2023-06-08 08:46:53 +00:00
<Border x:Name="BdrImage" Margin="10,35,0,10" CornerRadius="5"
2023-06-05 08:48:06 +00:00
Visibility="{Binding IsChecked,Converter={StaticResource {x:Static pu:ConverterKeys.TrueToCollapseConverter}}, ElementName=TbtnDetail}">
2023-06-08 08:46:53 +00:00
<Image Source="{Binding ImageSource}" Stretch="UniformToFill" />
2023-06-05 08:42:20 +00:00
</Border>
2023-06-08 08:46:53 +00:00
<ToggleButton x:Name="TbtnStar" Grid.ColumnSpan="2" Margin="0,5,32,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="30" Height="30" Padding="0" FontSize="22"
Foreground="#FFB300" Background="Transparent" ToolTip="收藏食物"
2023-06-08 08:46:53 +00:00
pu:ToggleButtonHelper.CornerRadius="5" pu:ToggleButtonHelper.CheckedContent="&#xF186;"
pu:IconHelper.Margin="0" FontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
Content="&#xF18B;" IsChecked="{Binding Star}" />
<ToggleButton x:Name="TbtnDetail" Grid.ColumnSpan="2" Margin="0,5,8,0" HorizontalAlignment="Right"
VerticalAlignment="Top" Width="30" Height="30" Padding="0" FontSize="22"
Foreground="{DynamicResource PrimaryText}" Background="Transparent" ToolTip="物品详情"
pu:ToggleButtonHelper.CornerRadius="5"
pu:ToggleButtonHelper.CheckedForeground="{DynamicResource DARKPrimaryText}"
pu:IconHelper.Margin="0" FontFamily="/VPet-Simulator.Windows;component/Res/#remixicon"
Content="&#xEF78;" />
2023-06-05 08:42:20 +00:00
</Grid>
</Grid>
2023-06-08 08:46:53 +00:00
<!--<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Discount}" Value="100">
<Setter TargetName="TxtPrice" Property="Foreground" Value="{DynamicResource DARKPrimary}" />
<Setter TargetName="TxtPrice" Property="FontSize" Value="18" />
<Setter TargetName="TxtPrice" Property="TextDecorations" Value="None" />
-->
<!--<Setter TargetName="TxtDiscountPrice" Property="Visibility" Value="Collapsed" />-->
<!--
2023-06-05 08:42:20 +00:00
</DataTrigger>
2023-06-08 08:46:53 +00:00
</DataTemplate.Triggers>-->
2023-06-05 08:42:20 +00:00
</DataTemplate>
</Window.Resources>
2023-06-01 14:50:40 +00:00
<Grid>
2023-06-05 08:42:20 +00:00
<Grid.ColumnDefinitions>
<ColumnDefinition Width="200" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Border Background="{DynamicResource DARKPrimaryText}" />
<Grid Margin="12, 10">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
2023-06-08 08:46:53 +00:00
<RowDefinition Height="3*" />
2023-06-05 08:42:20 +00:00
<RowDefinition Height="Auto" />
2023-06-08 08:46:53 +00:00
<RowDefinition Height="2*" />
2023-06-05 08:42:20 +00:00
</Grid.RowDefinitions>
2023-06-08 11:44:41 +00:00
<TextBlock Text="商品分类" FontSize="18" Margin="5" Foreground="{DynamicResource DARKPrimary}" />
2023-06-08 08:46:53 +00:00
<ListBox x:Name="LsbCategory" Grid.Row="1" Margin="-12,10,-12,0" Background="Transparent"
BorderThickness="0" SelectedIndex="0" pu:ListBoxHelper.ItemsPadding="15,8"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectionChanged="LsbSortRule_SelectionChanged">
<ListBoxItem Content="全部" />
<ListBoxItem Content="收藏" />
<ListBoxItem Content="正餐" />
<ListBoxItem Content="零食" />
2023-06-05 08:42:20 +00:00
<ListBoxItem Content="饮料" />
2023-06-08 08:46:53 +00:00
<ListBoxItem Content="功能性" />
2023-06-05 08:42:20 +00:00
<ListBoxItem Content="药品" />
</ListBox>
2023-06-08 11:44:41 +00:00
<TextBlock Grid.Row="2" Text="排序方式" Margin="5" FontSize="18" Foreground="{DynamicResource DARKPrimary}" />
2023-06-08 08:46:53 +00:00
<Border Grid.Row="3" Margin="0,10,0,0" MinHeight="100" CornerRadius="5">
2023-06-05 08:42:20 +00:00
<Grid VerticalAlignment="Top">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
2023-06-08 08:46:53 +00:00
<ListBox x:Name="LsbSortRule" Background="Transparent" BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5" pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0" SelectionChanged="LsbSortRule_SelectionChanged">
<ListBoxItem Content="按名字" />
2023-06-05 08:42:20 +00:00
<ListBoxItem Content="按价格" />
2023-06-08 08:46:53 +00:00
<ListBoxItem Content="按饱腹度" />
<ListBoxItem Content="按口渴度" />
2023-06-05 08:42:20 +00:00
<ListBoxItem Content="按体力" />
<ListBoxItem Content="按心情" />
2023-06-08 08:46:53 +00:00
<ListBoxItem Content="按健康" />
2023-06-05 08:42:20 +00:00
</ListBox>
2023-06-08 08:46:53 +00:00
<Rectangle Grid.Column="1" Margin="10,0,10,0" Width="1" Fill="{DynamicResource DARKPrimaryTrans4}" />
<ListBox x:Name="LsbSortAsc" Grid.Column="2" Background="Transparent" BorderThickness="0"
pu:ListBoxHelper.ItemsPadding="10,5" pu:ListBoxHelper.ItemsCornerRadius="4"
pu:ListBoxHelper.ItemsSelectedBackground="{DynamicResource DARKPrimary}"
pu:ListBoxHelper.ItemsSelectedForeground="{DynamicResource DARKPrimaryText}"
SelectedIndex="0" SelectionChanged="LsbSortRule_SelectionChanged">
2023-06-05 08:42:20 +00:00
<ListBoxItem Content="升序" />
<ListBoxItem Content="降序" />
</ListBox>
</Grid>
</Border>
</Grid>
2023-06-08 08:46:53 +00:00
<Grid Margin="10" Grid.Column="1">
2023-06-08 21:06:46 +00:00
<ScrollViewer x:Name="PageDetail">
2023-06-08 08:46:53 +00:00
<ItemsControl x:Name="IcCommodity" VerticalAlignment="Top">
2023-06-05 08:42:20 +00:00
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<local:AutoUniformGrid ItemsMinWidth="250" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
2023-06-08 08:46:53 +00:00
<ContentControl Height="140" Margin="0,0,10,10" Content="{Binding}"
ContentTemplate="{StaticResource CommodityDataTemplate}" />
2023-06-05 08:42:20 +00:00
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
2023-06-01 14:50:40 +00:00
</Grid>
2023-06-05 08:42:20 +00:00
</pu:WindowX>