| 1 | <Page xmlns:Select="clr-namespace:UI.Controls.Select" |
| 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:Charts="clr-namespace:UI.Controls.Charts" |
| 7 | xmlns:DatePickerBar="clr-namespace:UI.Controls.DatePickerBar" x:Class="UI.Views.DetailPage" |
| 8 | mc:Ignorable="d" |
| 9 | d:DesignHeight="450" d:DesignWidth="800" |
| 10 | Title="DetailPage" |
| 11 | xmlns:btn="clr-namespace:UI.Controls.Button" |
| 12 | xmlns:base="clr-namespace:UI.Controls.Base" xmlns:Tabbar="clr-namespace:UI.Controls.Tabbar" Foreground="{DynamicResource StandardTextBrush}" Background="Transparent"> |
| 13 | <Page.ContextMenu> |
| 14 | <ContextMenu> |
| 15 | <MenuItem Header="刷新" Command="{Binding RefreshCommand}"/> |
| 16 | </ContextMenu> |
| 17 | </Page.ContextMenu> |
| 18 | <StackPanel Margin="20"> |
| 19 | <TextBlock Text="应用" FontSize="18" Margin="0,0,0,20"/> |
| 20 | |
| 21 | <Border |
| 22 | Background="{DynamicResource SettingPanelBgBrush}" |
| 23 | CornerRadius="12" |
| 24 | Padding="0,20" |
| 25 | ContextMenu="{Binding AppContextMenu}"> |
| 26 | <Grid> |
| 27 | <Grid.ColumnDefinitions> |
| 28 | <ColumnDefinition Width="100"/> |
| 29 | <ColumnDefinition Width="9*"/> |
| 30 | <ColumnDefinition Width="3*"/> |
| 31 | |
| 32 | </Grid.ColumnDefinitions> |
| 33 | <base:Img URL="{Binding App.IconFile}" Width="25" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center"/> |
| 34 | |
| 35 | |
| 36 | <StackPanel Grid.Column="1" VerticalAlignment="Center"> |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | <base:View Condition="=False" Value="{Binding IsRegexIgnore}"> |
| 49 | <Border Background="#f51837" Padding="10,5" CornerRadius="4" Margin="0,0,0,5" VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="{Binding CancelBlockBtnVisibility}" ToolTip="该应用将不再统计使用时长"> |
| 50 | <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 51 | <base:Icon IconType="StatusCircleBlock" FontSize="12" VerticalAlignment="Center" Foreground="White"/> |
| 52 | <TextBlock Text="已被忽略" Foreground="White" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 53 | </StackPanel> |
| 54 | </Border> |
| 55 | </base:View> |
| 56 | <base:View Value="{Binding IsRegexIgnore}"> |
| 57 | <Border Background="#f51837" Padding="10,5" CornerRadius="4" Margin="0,0,0,5" VerticalAlignment="Center" HorizontalAlignment="Left" ToolTip="该应用将不再统计使用时长"> |
| 58 | <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 59 | <base:Icon IconType="StatusCircleBlock" FontSize="12" VerticalAlignment="Center" Foreground="White"/> |
| 60 | <TextBlock Text="已被正则忽略匹配" Foreground="White" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 61 | </StackPanel> |
| 62 | </Border> |
| 63 | </base:View> |
| 64 | <base:View Value="{Binding App.Alias}" Condition="not empty"> |
| 65 | <StackPanel> |
| 66 | <TextBlock ToolTip="别名" Grid.Column="1" Text="{Binding App.Alias}" FontSize="18" VerticalAlignment="Center" TextWrapping="WrapWithOverflow"/> |
| 67 | <TextBlock FontSize="12" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"> |
| 68 | <Run ToolTip="应用进程名称" Text="{Binding App.Name}"></Run> |
| 69 | <Run>(</Run> |
| 70 | <Run ToolTip="应用描述" Text="{Binding App.Description}"></Run> |
| 71 | <Run>)</Run> |
| 72 | |
| 73 | </TextBlock> |
| 74 | </StackPanel> |
| 75 | </base:View> |
| 76 | <base:View Value="{Binding App.Alias}" Condition="empty"> |
| 77 | <StackPanel> |
| 78 | <TextBlock ToolTip="应用描述" Grid.Column="1" Text="{Binding App.Description}" FontSize="18" VerticalAlignment="Center" TextWrapping="WrapWithOverflow"/> |
| 79 | |
| 80 | <TextBlock ToolTip="应用进程名称" Text="{Binding App.Name}" FontSize="12" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"/> |
| 81 | </StackPanel> |
| 82 | </base:View> |
| 83 | |
| 84 | <TextBlock ToolTip="应用文件路径" Foreground="Gray" Text="{Binding App.File}" Margin="0,5,0,0" TextWrapping="WrapWithOverflow"/> |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | <base:View Condition="not null" Value="{Binding Category}" HorizontalAlignment="Left"> |
| 96 | <Select:Select Margin="0,10,0,0" ToolTip="分类" SelectedItem="{Binding Category,Mode=TwoWay}" Options="{Binding Categorys}" Padding="10,0" Height="30"/> |
| 97 | </base:View> |
| 98 | |
| 99 | |
| 100 | </StackPanel> |
| 101 | <Grid Grid.Column="2"> |
| 102 | <base:View Condition="=False" Value="{Binding IsRegexIgnore}" HorizontalAlignment="Right" Margin="0,0,20,0"> |
| 103 | <StackPanel> |
| 104 | <btn:Button Command="{Binding BlockActionCommand}" CommandParameter="block" Width="120" Visibility="{Binding BlockBtnVisibility}" Icon="StatusCircleBlock">忽略此应用</btn:Button> |
| 105 | <btn:Button Command="{Binding BlockActionCommand}" CommandParameter="unblock" Width="120" Visibility="{Binding CancelBlockBtnVisibility}" Icon="Remove">取消忽略</btn:Button> |
| 106 | |
| 107 | </StackPanel> |
| 108 | </base:View> |
| 109 | <ItemsControl Margin="0,20,10,0" VerticalAlignment="Bottom" ItemsSource="{Binding LinkApps}" HorizontalAlignment="Right"> |
| 110 | <ItemsControl.ItemsPanel> |
| 111 | <ItemsPanelTemplate> |
| 112 | <StackPanel ToolTip="关联" ScrollViewer.HorizontalScrollBarVisibility="Visible" Orientation="Horizontal" VerticalAlignment="Center"/> |
| 113 | </ItemsPanelTemplate> |
| 114 | </ItemsControl.ItemsPanel> |
| 115 | <ItemsControl.ItemTemplate> |
| 116 | <DataTemplate> |
| 117 | <base:Img Margin="2,0" URL="{Binding IconFile}" Width="20" Height="20" ToolTip="{Binding Description}"/> |
| 118 | </DataTemplate> |
| 119 | </ItemsControl.ItemTemplate> |
| 120 | </ItemsControl> |
| 121 | </Grid> |
| 122 | </Grid> |
| 123 | </Border> |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | <WrapPanel Margin="-10"> |
| 147 | <StackPanel Margin="10,10,0,0"> |
| 148 | <TextBlock Text="时长统计" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/> |
| 149 | |
| 150 | <Border Margin="0,10,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10"> |
| 151 | <StackPanel> |
| 152 | <Tabbar:Tabbar Margin="0,-10,0,0" Data="{Binding TabbarData}" SelectedIndex="{Binding TabbarSelectedIndex,Mode=TwoWay}" Width="180" HorizontalAlignment="Left"/> |
| 153 | |
| 154 | <Grid > |
| 155 | |
| 156 | <base:View Condition="0" Value="{Binding TabbarSelectedIndex}"> |
| 157 | <Select:DateSelect Date="{Binding ChartDate,Mode=TwoWay}"/> |
| 158 | </base:View> |
| 159 | |
| 160 | |
| 161 | <base:View Condition="1" Value="{Binding TabbarSelectedIndex}"> |
| 162 | <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 163 | <Select:Select IsShowIcon="False" SelectedItem="{Binding SelectedWeek,Mode=TwoWay}" Options="{Binding WeekOptions}"/> |
| 164 | <TextBlock Foreground="{DynamicResource DefaultTextBrush}" Margin="20,0,0,0" FontSize="14" Text="{Binding WeekDateStr}" VerticalAlignment="Center"/> |
| 165 | </StackPanel> |
| 166 | </base:View> |
| 167 | |
| 168 | <base:View Condition="2" Value="{Binding TabbarSelectedIndex}"> |
| 169 | <Select:DateSelect Date="{Binding MonthDate,Mode=TwoWay}" SelectType="Month"/> |
| 170 | |
| 171 | </base:View> |
| 172 | |
| 173 | <base:View Condition="3" Value="{Binding TabbarSelectedIndex}"> |
| 174 | <Select:DateSelect Date="{Binding YearDate,Mode=TwoWay}" SelectType="Year"/> |
| 175 | |
| 176 | </base:View> |
| 177 | </Grid> |
| 178 | <Charts:Charts IsShowCategory="False" DataMaximum="{Binding DataMaximum}" Height="305" NameIndexStart="{Binding NameIndexStart}" ChartsType="Column" Data="{Binding ChartData}" Margin="0,20,0,0"/> |
| 179 | |
| 180 | </StackPanel> |
| 181 | |
| 182 | </Border> |
| 183 | </StackPanel> |
| 184 | |
| 185 | <StackPanel Margin="10,0,0,0" VerticalAlignment="Bottom" Width="680"> |
| 186 | <TextBlock Text="月度总览" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/> |
| 187 | |
| 188 | <Border |
| 189 | Background="{DynamicResource SettingPanelBgBrush}" |
| 190 | CornerRadius="12" |
| 191 | Padding="20,20" |
| 192 | Margin="0,10,0,0"> |
| 193 | <StackPanel> |
| 194 | <Grid> |
| 195 | <DatePickerBar:DatePickerBar ShowType="Month" HorizontalAlignment="Left" SelectedDate="{Binding Date,Mode=TwoWay}"/> |
| 196 | |
| 197 | <btn:Button ToolTip="清空此应用在该月的统计数据" HorizontalAlignment="Right" VerticalAlignment="Top" Background="#f51837" Foreground="White" Width="120" Margin="0" Icon="Delete" Command="{Binding ClearSelectMonthDataCommand}">清空该月统计</btn:Button> |
| 198 | |
| 199 | </Grid> |
| 200 | <Grid Margin="0,20,0,0"> |
| 201 | <Grid.ColumnDefinitions> |
| 202 | <ColumnDefinition Width="256"/> |
| 203 | <ColumnDefinition Width="9*"/> |
| 204 | |
| 205 | </Grid.ColumnDefinitions> |
| 206 | <Charts:Charts Data="{Binding Data}" ChartsType="Month" HorizontalAlignment="Left"/> |
| 207 | <StackPanel Grid.Column="1" > |
| 208 | <Border Padding="15" CornerRadius="10" BorderThickness="0"> |
| 209 | <Border.Background> |
| 210 | <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".08"/> |
| 211 | </Border.Background> |
| 212 | <Border.BorderBrush> |
| 213 | <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".5"/> |
| 214 | </Border.BorderBrush> |
| 215 | <Grid> |
| 216 | <Grid> |
| 217 | <Grid.RowDefinitions> |
| 218 | <RowDefinition Height="auto"/> |
| 219 | <RowDefinition Height="auto"/> |
| 220 | </Grid.RowDefinitions> |
| 221 | <TextBlock FontSize="14"><Run Text="该月累计使用 " Foreground="{DynamicResource SubTextBrush}" /><Run Foreground="{DynamicResource DefaultTextBrush}" FontSize="16" Text="{Binding Total}"/> |
| 222 | </TextBlock> |
| 223 | <TextBlock Grid.Row="1" Margin="0,5,0,0" FontSize="14"><Run Text="{Binding LongDay}"/> |
| 224 | </TextBlock> |
| 225 | </Grid> |
| 226 | <base:Icon IconType="DateTimeMirrored" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".5"/> |
| 227 | </Grid> |
| 228 | </Border> |
| 229 | <Border Margin="0,10,0,0" Padding="15" CornerRadius="10" BorderThickness="0"> |
| 230 | <Border.Background> |
| 231 | <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".08"/> |
| 232 | </Border.Background> |
| 233 | <Border.BorderBrush> |
| 234 | <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".5"/> |
| 235 | </Border.BorderBrush> |
| 236 | <Grid> |
| 237 | <Grid> |
| 238 | <Grid.RowDefinitions> |
| 239 | <RowDefinition Height="auto"/> |
| 240 | <RowDefinition Height="auto"/> |
| 241 | </Grid.RowDefinitions> |
| 242 | <TextBlock Foreground="{DynamicResource SubTextBrush}" Text="在当月所有使用应用时长中占比" FontSize="14" /> |
| 243 | |
| 244 | <TextBlock Foreground="{DynamicResource DefaultTextBrush}" Grid.Row="1" Margin="0,10,0,0" FontSize="24"><Run Text="{Binding Ratio}"/> |
| 245 | </TextBlock> |
| 246 | </Grid> |
| 247 | <base:Icon IconType="ReportDocument" HorizontalAlignment="Right" VerticalAlignment="Bottom" FontSize="30" Foreground="{DynamicResource ThemeBrush}" Opacity=".5"/> |
| 248 | </Grid> |
| 249 | </Border> |
| 250 | |
| 251 | </StackPanel> |
| 252 | </Grid> |
| 253 | </StackPanel> |
| 254 | </Border> |
| 255 | </StackPanel> |
| 256 | </WrapPanel> |
| 257 | |
| 258 | |
| 259 | |
| 260 | </StackPanel> |
| 261 | </Page> |