| 1 | <c:TPage xmlns:Button="clr-namespace:UI.Controls.Button" x:Class="UI.Views.CategoryAppListPage" |
| 2 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 5 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 6 | xmlns:local="clr-namespace:UI.Views" xmlns:base="clr-namespace:UI.Controls.Base" xmlns:select="clr-namespace:UI.Controls.Select" xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:input="clr-namespace:UI.Controls.Input" |
| 7 | xmlns:c="clr-namespace:UI.Controls" |
| 8 | mc:Ignorable="d" |
| 9 | d:DesignHeight="450" d:DesignWidth="800" |
| 10 | Title="CategoryAppListPage" Foreground="{DynamicResource StandardTextBrush}" IsFillPage="True"> |
| 11 | |
| 12 | <Grid> |
| 13 | |
| 14 | <Grid Visibility="{Binding ChooseVisibility}" Panel.ZIndex="2" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> |
| 15 | <Border Background="Black" Opacity=".7"/> |
| 16 | <Border Background="{DynamicResource PopupBackgroundBrush}" CornerRadius="10" BorderBrush="{DynamicResource PopupBorderBrush}" BorderThickness="1" Margin="50" VerticalAlignment="Top"> |
| 17 | <Grid> |
| 18 | <Grid.RowDefinitions> |
| 19 | <RowDefinition Height="40"/> |
| 20 | <RowDefinition Height="auto"/> |
| 21 | <RowDefinition Height="*"/> |
| 22 | <RowDefinition Height="80"/> |
| 23 | |
| 24 | </Grid.RowDefinitions> |
| 25 | <Grid> |
| 26 | <TextBlock Text="选择应用" VerticalAlignment="Center" Margin="10,0,0,0"/> |
| 27 | <Button:IconButton Foreground="#ccc" Icon="ChromeClose" HorizontalAlignment="Right" FontSize="12" Margin="0,0,10,0" Command="{Binding ChooseCloseCommand}"/> |
| 28 | </Grid> |
| 29 | <Border Grid.Row="1"> |
| 30 | <input:InputBox Placeholder="搜索应用" Margin="10" x:Name="SearchBox" Text="{Binding SearchInput,Mode=TwoWay}"> |
| 31 | <i:Interaction.Triggers> |
| 32 | <i:EventTrigger EventName="KeyUp"> |
| 33 | <i:InvokeCommandAction Command="{Binding Path=SearchCommand}" CommandParameter="{Binding ElementName=SearchBox,Path=Text}"/> |
| 34 | </i:EventTrigger> |
| 35 | </i:Interaction.Triggers> |
| 36 | </input:InputBox> |
| 37 | </Border> |
| 38 | <ListView ItemsSource="{Binding AppList}" Margin="20,0" Grid.Row="2" VirtualizingPanel.IsVirtualizing="True" ScrollViewer.CanContentScroll="True"> |
| 39 | <ListBox.Resources> |
| 40 | <Style TargetType="{x:Type ListView}"> |
| 41 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 42 | |
| 43 | <Setter Property="Template"> |
| 44 | <Setter.Value> |
| 45 | <ControlTemplate TargetType="{x:Type ListView}"> |
| 46 | <ScrollViewer> |
| 47 | <ItemsPresenter /> |
| 48 | </ScrollViewer> |
| 49 | </ControlTemplate> |
| 50 | </Setter.Value> |
| 51 | </Setter> |
| 52 | </Style> |
| 53 | <Style TargetType="{x:Type ListViewItem}"> |
| 54 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 55 | <Setter Property="Template"> |
| 56 | <Setter.Value> |
| 57 | <ControlTemplate TargetType="{x:Type ListViewItem}"> |
| 58 | <Border> |
| 59 | <ContentPresenter/> |
| 60 | </Border> |
| 61 | |
| 62 | </ControlTemplate> |
| 63 | </Setter.Value> |
| 64 | </Setter> |
| 65 | |
| 66 | </Style> |
| 67 | </ListBox.Resources> |
| 68 | <ListBox.ItemsPanel> |
| 69 | <ItemsPanelTemplate> |
| 70 | <VirtualizingStackPanel/> |
| 71 | |
| 72 | </ItemsPanelTemplate> |
| 73 | </ListBox.ItemsPanel> |
| 74 | <ListView.ItemTemplate> |
| 75 | <DataTemplate> |
| 76 | |
| 77 | |
| 78 | <select:Option Visibility="{Binding Visibility}" HorizontalAlignment="Stretch" IsChecked="{Binding IsChoosed,Mode=TwoWay}" Value="{Binding Value}"/> |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | </DataTemplate> |
| 84 | </ListView.ItemTemplate> |
| 85 | </ListView> |
| 86 | |
| 87 | <Button:Button Grid.Row="3" HorizontalAlignment="Right" Content="完成" Width="120" Margin="0,0,10,0" VerticalAlignment="Center" Command="{Binding ChoosedCommand}"/> |
| 88 | </Grid> |
| 89 | |
| 90 | </Border> |
| 91 | </Grid> |
| 92 | |
| 93 | |
| 94 | <Grid Margin="20"> |
| 95 | <Grid.RowDefinitions> |
| 96 | <RowDefinition Height="auto"/> |
| 97 | <RowDefinition Height="auto"/> |
| 98 | <RowDefinition Height="*"/> |
| 99 | </Grid.RowDefinitions> |
| 100 | <StackPanel Orientation="Horizontal" Margin="0,0,0,20"> |
| 101 | <TextBlock FontSize="18" Text="应用分类"/> |
| 102 | <base:Icon IconType="ChevronRightMed" Margin="10,0" FontSize="12" Foreground="#ccc"/> |
| 103 | <TextBlock FontSize="18" Text="{Binding Category.Data.Name}"/> |
| 104 | |
| 105 | </StackPanel> |
| 106 | <TextBlock Grid.Row="1" Text="应用列表"/> |
| 107 | |
| 108 | <Button:Button Grid.Row="1" Content="选择" HorizontalAlignment="Right" Width="150" Command="{Binding ShowChooseCommand}"/> |
| 109 | <base:View Grid.Row="2" Condition="empty" Value="{Binding Data}"> |
| 110 | <base:EmptyData/> |
| 111 | </base:View> |
| 112 | <ListView Grid.Row="2" ItemsSource="{Binding Data}" SelectedItem="{Binding SelectedItem,Mode=TwoWay}" Margin="0,20,0,0" VirtualizingPanel.IsVirtualizing="True" ScrollViewer.CanContentScroll="True"> |
| 113 | <ListView.ContextMenu> |
| 114 | <ContextMenu> |
| 115 | |
| 116 | <MenuItem Header="从分类中移除" Command="{Binding DelCommand}" CommandParameter="{Binding SelectedItem}"/> |
| 117 | </ContextMenu> |
| 118 | </ListView.ContextMenu> |
| 119 | <i:Interaction.Triggers> |
| 120 | <i:EventTrigger EventName="MouseLeftButtonUp"> |
| 121 | <i:InvokeCommandAction Command="{Binding GotoDetailCommand}" |
| 122 | CommandParameter="{Binding SelectedItem}" /> |
| 123 | </i:EventTrigger> |
| 124 | </i:Interaction.Triggers> |
| 125 | <ListBox.Resources> |
| 126 | <Style TargetType="{x:Type ListView}"> |
| 127 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 128 | |
| 129 | <Setter Property="Template"> |
| 130 | <Setter.Value> |
| 131 | <ControlTemplate TargetType="{x:Type ListView}"> |
| 132 | <ScrollViewer> |
| 133 | <ItemsPresenter /> |
| 134 | </ScrollViewer> |
| 135 | </ControlTemplate> |
| 136 | </Setter.Value> |
| 137 | </Setter> |
| 138 | </Style> |
| 139 | <Style TargetType="{x:Type ListViewItem}"> |
| 140 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 141 | <Setter Property="Template"> |
| 142 | <Setter.Value> |
| 143 | <ControlTemplate TargetType="{x:Type ListViewItem}"> |
| 144 | <Grid> |
| 145 | <Border BorderBrush="{Binding ElementName=Border,Path=BorderBrush}" BorderThickness="{Binding ElementName=Border,Path=BorderThickness}" Background="{Binding ElementName=Border,Path=Background}" Margin="{Binding ElementName=Border,Path=Margin}" CornerRadius="{Binding ElementName=Border,Path=CornerRadius}"> |
| 146 | <Border.Effect> |
| 147 | <DropShadowEffect Color="#f3f3f3" BlurRadius="1" Direction="300" ShadowDepth="4" Opacity="0.15" RenderingBias="Performance" ></DropShadowEffect> |
| 148 | </Border.Effect> |
| 149 | </Border> |
| 150 | |
| 151 | <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{DynamicResource StandardBackgroundBrush2}" Margin="0,0,0,10" Padding="15" CornerRadius="10"> |
| 152 | |
| 153 | <ContentPresenter/> |
| 154 | </Border> |
| 155 | </Grid> |
| 156 | <ControlTemplate.Triggers> |
| 157 | <Trigger Property="IsMouseOver" Value="True"> |
| 158 | |
| 159 | <Setter TargetName="Border" Property="BorderBrush" Value="#2b20d9"/> |
| 160 | |
| 161 | </Trigger> |
| 162 | </ControlTemplate.Triggers> |
| 163 | </ControlTemplate> |
| 164 | </Setter.Value> |
| 165 | </Setter> |
| 166 | |
| 167 | </Style> |
| 168 | </ListBox.Resources> |
| 169 | <ListBox.ItemsPanel> |
| 170 | <ItemsPanelTemplate> |
| 171 | <VirtualizingStackPanel/> |
| 172 | </ItemsPanelTemplate> |
| 173 | </ListBox.ItemsPanel> |
| 174 | <ListView.ItemTemplate> |
| 175 | <DataTemplate> |
| 176 | <Grid> |
| 177 | <Grid.ColumnDefinitions> |
| 178 | <ColumnDefinition Width="50"/> |
| 179 | <ColumnDefinition Width="auto"/> |
| 180 | </Grid.ColumnDefinitions> |
| 181 | <Border> |
| 182 | <base:Img Width="25" Height="25" URL="{Binding IconFile}"/> |
| 183 | </Border> |
| 184 | <Grid Grid.Column="1"> |
| 185 | <TextBlock Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Description}" /> |
| 186 | <base:View Condition="empty" Value="{Binding Description}"> |
| 187 | <TextBlock Margin="10,0,0,0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Name}" /> |
| 188 | |
| 189 | </base:View> |
| 190 | </Grid> |
| 191 | |
| 192 | |
| 193 | </Grid> |
| 194 | </DataTemplate> |
| 195 | </ListView.ItemTemplate> |
| 196 | </ListView> |
| 197 | </Grid> |
| 198 | |
| 199 | |
| 200 | </Grid> |
| 201 | |
| 202 | </c:TPage> |