| 1 | <Page x:Class="UI.Views.WebSiteDetailPage" |
| 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:charts="clr-namespace:UI.Controls.Charts" xmlns:select="clr-namespace:UI.Controls.Select" xmlns:tabbar="clr-namespace:UI.Controls.Tabbar" |
| 7 | mc:Ignorable="d" |
| 8 | d:DesignHeight="450" d:DesignWidth="800" |
| 9 | Title="WebSiteDetailPage" Foreground="{DynamicResource StandardTextBrush}" xmlns:converter="clr-namespace:UI.Controls.Converters"> |
| 10 | <Page.Resources> |
| 11 | <converter:TimeConverter x:Key="TimeConverter"/> |
| 12 | <converter:DateTimeConverter x:Key="DateTimeConverter"/> |
| 13 | <converter:GetCountConverter x:Key="GetCountConverter"/> |
| 14 | </Page.Resources> |
| 15 | <Grid> |
| 16 | <StackPanel Margin="20"> |
| 17 | <TextBlock Text="网站" FontSize="18" Margin="0,0,0,20"/> |
| 18 | |
| 19 | |
| 20 | <Border |
| 21 | Background="{DynamicResource SettingPanelBgBrush}" |
| 22 | CornerRadius="12" |
| 23 | Padding="20" |
| 24 | ContextMenu="{Binding WebSiteContextMenu}"> |
| 25 | <Grid> |
| 26 | <Grid.ColumnDefinitions> |
| 27 | <ColumnDefinition Width="auto"/> |
| 28 | <ColumnDefinition Width="*"/> |
| 29 | </Grid.ColumnDefinitions> |
| 30 | <base:Img URL="{Binding WebSite.IconFile}" Width="25" Height="25" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20,0"/> |
| 31 | <StackPanel Grid.Column="1"> |
| 32 | <base:View Value="{Binding IsIgnore}"> |
| 33 | <Border Background="#f51837" Padding="10,5" CornerRadius="4" Margin="0,0,0,5" VerticalAlignment="Center" HorizontalAlignment="Left" ToolTip="该站点数据将不会被统计"> |
| 34 | <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 35 | <base:Icon IconType="StatusCircleBlock" FontSize="12" VerticalAlignment="Center" Foreground="White"/> |
| 36 | <TextBlock Text="已被忽略" Foreground="White" VerticalAlignment="Center" Margin="5,0,0,0"/> |
| 37 | </StackPanel> |
| 38 | </Border> |
| 39 | </base:View> |
| 40 | <base:View Value="{Binding WebSite.Alias}" Condition="not empty"> |
| 41 | <StackPanel> |
| 42 | <TextBlock ToolTip="别名" Grid.Column="1" Text="{Binding WebSite.Alias}" FontSize="18" VerticalAlignment="Center" TextWrapping="WrapWithOverflow"/> |
| 43 | <TextBlock FontSize="12" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,5,0,0"> |
| 44 | <Run ToolTip="域名" Text="{Binding WebSite.Domain}"></Run> |
| 45 | <Run>(</Run> |
| 46 | <Run ToolTip="网站名称" Text="{Binding WebSite.Title}"></Run> |
| 47 | <Run>)</Run> |
| 48 | |
| 49 | </TextBlock> |
| 50 | </StackPanel> |
| 51 | </base:View> |
| 52 | <base:View Value="{Binding WebSite.Alias}" Condition="empty"> |
| 53 | <StackPanel> |
| 54 | <TextBlock ToolTip="网站名称" Text="{Binding WebSite.Title}" FontSize="18" VerticalAlignment="Center" TextWrapping="WrapWithOverflow"/> |
| 55 | <TextBlock ToolTip="域名" Text="{Binding WebSite.Domain}" FontSize="12" Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="0,0,0,0"/> |
| 56 | </StackPanel> |
| 57 | </base:View> |
| 58 | |
| 59 | <base:View Condition="not null" Value="{Binding Category}" HorizontalAlignment="Left"> |
| 60 | <select:Select Margin="0,10,0,0" ToolTip="网站分类" SelectedItem="{Binding Category,Mode=TwoWay}" Options="{Binding Categories}" Padding="10,0" Height="30"/> |
| 61 | |
| 62 | </base:View> |
| 63 | </StackPanel> |
| 64 | </Grid> |
| 65 | </Border> |
| 66 | |
| 67 | <tabbar:Tabbar Margin="0,15,0,5" Data="{Binding TabbarData}" SelectedIndex="{Binding TabbarSelectedIndex,Mode=TwoWay}" Width="180" HorizontalAlignment="Left"/> |
| 68 | |
| 69 | <Grid > |
| 70 | |
| 71 | <base:View Condition="0" Value="{Binding TabbarSelectedIndex}"> |
| 72 | <select:DateSelect Date="{Binding ChartDate,Mode=TwoWay}"/> |
| 73 | </base:View> |
| 74 | |
| 75 | |
| 76 | <base:View Condition="1" Value="{Binding TabbarSelectedIndex}"> |
| 77 | <StackPanel Orientation="Horizontal" VerticalAlignment="Center"> |
| 78 | <select:Select IsShowIcon="False" SelectedItem="{Binding SelectedWeek,Mode=TwoWay}" Options="{Binding WeekOptions}"/> |
| 79 | <TextBlock Foreground="{DynamicResource DefaultTextBrush}" Margin="20,0,0,0" FontSize="14" Text="{Binding WeekDateStr}" VerticalAlignment="Center"/> |
| 80 | </StackPanel> |
| 81 | </base:View> |
| 82 | |
| 83 | <base:View Condition="2" Value="{Binding TabbarSelectedIndex}"> |
| 84 | <select:DateSelect Date="{Binding MonthDate,Mode=TwoWay}" SelectType="Month"/> |
| 85 | |
| 86 | </base:View> |
| 87 | |
| 88 | <base:View Condition="3" Value="{Binding TabbarSelectedIndex}"> |
| 89 | <select:DateSelect Date="{Binding YearDate,Mode=TwoWay}" SelectType="Year"/> |
| 90 | |
| 91 | </base:View> |
| 92 | </Grid> |
| 93 | |
| 94 | <WrapPanel Margin="-10"> |
| 95 | <StackPanel Margin="10,10,0,0"> |
| 96 | |
| 97 | <TextBlock Text="时长统计" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/> |
| 98 | |
| 99 | <Border Margin="0,10,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10"> |
| 100 | <StackPanel> |
| 101 | |
| 102 | <charts:Charts IsShowCategory="False" DataMaximum="{Binding DataMaximum}" Height="305" NameIndexStart="{Binding NameIndexStart}" ChartsType="Column" Data="{Binding ChartData}" Margin="0,0,0,0"/> |
| 103 | |
| 104 | </StackPanel> |
| 105 | |
| 106 | </Border> |
| 107 | </StackPanel> |
| 108 | |
| 109 | <StackPanel Margin="10,10,0,0"> |
| 110 | <TextBlock Text="浏览详情" Foreground="#5c5c5c" FontSize="14" Margin="0,20,0,0"/> |
| 111 | |
| 112 | <Border Margin="0,10,0,0" Width="680" HorizontalAlignment="Left" Background="{DynamicResource SettingPanelBgBrush}" Padding="20" CornerRadius="10"> |
| 113 | <StackPanel> |
| 114 | <TextBlock FontSize="14" > |
| 115 | <Run Text="{Binding WebPageData,Converter={StaticResource GetCountConverter}}"/><Run Text=" 个网页"/> |
| 116 | </TextBlock> |
| 117 | <ListView Margin="0,20,0,0" MaxHeight="800" ItemsSource="{Binding WebPageData}" VirtualizingPanel.IsVirtualizing="True" ScrollViewer.CanContentScroll="True" SelectedItem="{Binding WebPageSelectedItem,Mode=TwoWay}"> |
| 118 | <ListView.ContextMenu> |
| 119 | <ContextMenu> |
| 120 | <MenuItem Header="打开网页" Command="{Binding PageCommand}" CommandParameter="Open"/> |
| 121 | <Separator/> |
| 122 | <MenuItem Header="复制链接" Command="{Binding PageCommand}" CommandParameter="CopyURL"/> |
| 123 | <MenuItem Header="复制标题" Command="{Binding PageCommand}" CommandParameter="CopyTitle"/> |
| 124 | </ContextMenu> |
| 125 | </ListView.ContextMenu> |
| 126 | <ListBox.Resources> |
| 127 | <Style TargetType="{x:Type ListView}"> |
| 128 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 129 | |
| 130 | <Setter Property="Template"> |
| 131 | <Setter.Value> |
| 132 | <ControlTemplate TargetType="{x:Type ListView}"> |
| 133 | <ScrollViewer> |
| 134 | <ItemsPresenter /> |
| 135 | </ScrollViewer> |
| 136 | </ControlTemplate> |
| 137 | </Setter.Value> |
| 138 | </Setter> |
| 139 | </Style> |
| 140 | <Style TargetType="{x:Type ListViewItem}"> |
| 141 | <Setter Property="OverridesDefaultStyle" Value="True"/> |
| 142 | <Setter Property="Template"> |
| 143 | <Setter.Value> |
| 144 | <ControlTemplate TargetType="{x:Type ListViewItem}"> |
| 145 | <Grid> |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="Transparent" Margin="0" Padding="0" CornerRadius="20"> |
| 153 | <Border BorderBrush="{DynamicResource SettingPanelSpliteLineBrush}" BorderThickness="0,0,0,.5" Padding="5,10,5,10"> |
| 154 | <ContentPresenter/> |
| 155 | </Border> |
| 156 | </Border> |
| 157 | </Grid> |
| 158 | <ControlTemplate.Triggers> |
| 159 | <Trigger Property="IsMouseOver" Value="True"> |
| 160 | <Setter TargetName="Border" Property="Background" Value="{DynamicResource HoverBackgroundBrush}"/> |
| 161 | |
| 162 | |
| 163 | </Trigger> |
| 164 | </ControlTemplate.Triggers> |
| 165 | </ControlTemplate> |
| 166 | </Setter.Value> |
| 167 | </Setter> |
| 168 | |
| 169 | </Style> |
| 170 | </ListBox.Resources> |
| 171 | <ListBox.ItemsPanel> |
| 172 | <ItemsPanelTemplate> |
| 173 | <VirtualizingStackPanel/> |
| 174 | </ItemsPanelTemplate> |
| 175 | </ListBox.ItemsPanel> |
| 176 | <ListView.ItemTemplate> |
| 177 | <DataTemplate> |
| 178 | <Grid> |
| 179 | <Grid.ColumnDefinitions> |
| 180 | <ColumnDefinition Width="auto"/> |
| 181 | <ColumnDefinition Width="*"/> |
| 182 | </Grid.ColumnDefinitions> |
| 183 | <base:Img Width="16" Height="16" URL="{Binding Url.IconFile}"/> |
| 184 | <Grid Margin="10,0,0,0" Grid.Column="1"> |
| 185 | <StackPanel> |
| 186 | <TextBlock FontSize="14" Foreground="{DynamicResource DefaultTextBrush}" Text="{Binding Url.Title}" TextWrapping="WrapWithOverflow"/> |
| 187 | <TextBlock Margin="0,2,0,0" Text="{Binding Url.Url}" Foreground="{DynamicResource SubTextBrush}" TextWrapping="WrapWithOverflow"/> |
| 188 | <StackPanel Orientation="Horizontal" Margin="0,10,0,0" > |
| 189 | <Border HorizontalAlignment="Left" Padding="10,5" CornerRadius="6" ToolTip="访问时间"> |
| 190 | <Border.Background> |
| 191 | <SolidColorBrush Color="{DynamicResource HoverBackgroundColor}" Opacity=".5"/> |
| 192 | </Border.Background> |
| 193 | <TextBlock Foreground="{DynamicResource SubTextBrush}" Text="{Binding LogTime,Converter={StaticResource DateTimeConverter}}" TextWrapping="WrapWithOverflow"/> |
| 194 | </Border> |
| 195 | <Border HorizontalAlignment="Left" Padding="10,5" CornerRadius="6" Margin="5,0,0,0" ToolTip="浏览时长"> |
| 196 | <Border.Background> |
| 197 | <SolidColorBrush Color="{DynamicResource ThemeColor}" Opacity=".2"/> |
| 198 | </Border.Background> |
| 199 | <TextBlock Foreground="{DynamicResource ThemeBrush}" Text="{Binding Duration,Converter={StaticResource TimeConverter}}" TextWrapping="WrapWithOverflow"/> |
| 200 | </Border> |
| 201 | </StackPanel> |
| 202 | </StackPanel> |
| 203 | </Grid> |
| 204 | </Grid> |
| 205 | </DataTemplate> |
| 206 | </ListView.ItemTemplate> |
| 207 | </ListView> |
| 208 | </StackPanel> |
| 209 | </Border> |
| 210 | </StackPanel> |
| 211 | </WrapPanel> |
| 212 | </StackPanel> |
| 213 | </Grid> |
| 214 | </Page> |