提交记录修改UI/Controls/Charts/Charts.cs+20 −1看文件
修改UI/Controls/Charts/ChartsItemTypeA.cs+17 −0看文件
新增UI/Controls/Charts/Model/ChartBadgeModel.cs+36 −0看文件
新增UI/Controls/Charts/Model/ChartBadgeType.cs+20 −0看文件
修改UI/Controls/Charts/Model/ChartsDataModel.cs+8 −1看文件
修改UI/Resources/Themes/Dark/Charts/ChartsItemTypeA.xaml+68 −2看文件
修改UI/Resources/Themes/Light/Charts/ChartsItemTypeA.xaml+69 −3看文件
修改UI/Servicers/AppContextMenuServicer.cs+27 −2看文件
修改UI/Servicers/MainServicer.cs+4 −1看文件
修改UI/Themes/Charts/ChartsItemTypeA.xaml+65 −1看文件
修改UI/UI.csproj+2 −0看文件
修改UI/ViewModels/DataPageVM.cs+18 −2看文件
修改UI/ViewModels/IndexPageVM.cs+0 −1看文件
修改UI/Views/DataPage.xaml+3 −3看文件
| @@ -361,6 +361,23 @@ namespace UI.Controls.Charts | ||
| 361 | 361 | typeof(Charts), new PropertyMetadata(-1, new PropertyChangedCallback(OnPropertyChanged))); |
| 362 | 362 | |
| 363 | 363 | |
| 364 | 新增: #endregion | |
| 365 | 新增: #region IsShowBadge 是否显示徽章 | |
| 366 | 新增: /// <summary> | |
| 367 | 新增: /// 是否显示徽章(默认不显示) | |
| 368 | 新增: /// </summary> | |
| 369 | 新增: public bool IsShowBadge | |
| 370 | 新增: { | |
| 371 | 新增: get { return (bool)GetValue(IsShowBadgeProperty); } | |
| 372 | 新增: set { SetValue(IsShowBadgeProperty, value); } | |
| 373 | 新增: } | |
| 374 | 新增: public static readonly DependencyProperty IsShowBadgeProperty = | |
| 375 | 新增: DependencyProperty.Register("IsShowBadge", | |
| 376 | 新增: typeof(bool), | |
| 377 | 新增: typeof(Charts), | |
| 378 | 新增: new PropertyMetadata(false)); | |
| 379 | 新增: | |
| 380 | 新增: | |
| 364 | 381 | #endregion |
| 365 | 382 | public bool IsShowValuesPopup |
| 366 | 383 | { |
| @@ -686,7 +703,7 @@ namespace UI.Controls.Charts | ||
| 686 | 703 | ScrollViewer.ScrollToVerticalOffset(0); |
| 687 | 704 | |
| 688 | 705 | var data = Data.OrderByDescending(x => x.Value).ToList(); |
| 689 | 删除: | |
| 706 | 新增: | |
| 690 | 707 | |
| 691 | 708 | //if (data.Count < 20) |
| 692 | 709 | //{ |
| @@ -799,6 +816,8 @@ namespace UI.Controls.Charts | ||
| 799 | 816 | chartsItem.Data = item; |
| 800 | 817 | chartsItem.ToolTip = item.PopupText; |
| 801 | 818 | chartsItem.MaxValue = maxValue; |
| 819 | 新增: chartsItem.IsShowBadge = IsShowBadge; | |
| 820 | 新增: | |
| 802 | 821 | if (i == 19 && isLazyloading) |
| 803 | 822 | { |
| 804 | 823 | chartsItem.Loaded += ChartsItem_Loaded; |
| @@ -70,6 +70,23 @@ namespace UI.Controls.Charts | ||
| 70 | 70 | typeof(ChartsItemTypeA)); |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 新增: #endregion | |
| 74 | 新增: | |
| 75 | 新增: #region IsShowBadge 是否显示徽章 | |
| 76 | 新增: /// <summary> | |
| 77 | 新增: /// 是否显示徽章 | |
| 78 | 新增: /// </summary> | |
| 79 | 新增: public bool IsShowBadge | |
| 80 | 新增: { | |
| 81 | 新增: get { return (bool)GetValue(IsShowBadgeProperty); } | |
| 82 | 新增: set { SetValue(IsShowBadgeProperty, value); } | |
| 83 | 新增: } | |
| 84 | 新增: public static readonly DependencyProperty IsShowBadgeProperty = | |
| 85 | 新增: DependencyProperty.Register("IsShowBadge", | |
| 86 | 新增: typeof(bool), | |
| 87 | 新增: typeof(ChartsItemTypeA)); | |
| 88 | 新增: | |
| 89 | 新增: | |
| 73 | 90 | #endregion |
| 74 | 91 | private TextBlock NameTextObj, ValueTextObj; |
| 75 | 92 | private Rectangle ValueBlockObj; |
| @@ -0,0 +1,36 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增: | |
| 7 | 新增:namespace UI.Controls.Charts.Model | |
| 8 | 新增:{ | |
| 9 | 新增: /// <summary> | |
| 10 | 新增: /// 徽章模型 | |
| 11 | 新增: /// </summary> | |
| 12 | 新增: public class ChartBadgeModel | |
| 13 | 新增: { | |
| 14 | 新增: /// <summary> | |
| 15 | 新增: /// 徽章名称 | |
| 16 | 新增: /// </summary> | |
| 17 | 新增: public string Name { get; set; } | |
| 18 | 新增: /// <summary> | |
| 19 | 新增: /// 徽章颜色 | |
| 20 | 新增: /// </summary> | |
| 21 | 新增: public string Color { get; set; } | |
| 22 | 新增: /// <summary> | |
| 23 | 新增: /// 徽章类型 | |
| 24 | 新增: /// </summary> | |
| 25 | 新增: public ChartBadgeType Type { get; set; } | |
| 26 | 新增: /// <summary> | |
| 27 | 新增: /// 忽略应用徽章 | |
| 28 | 新增: /// </summary> | |
| 29 | 新增: public static ChartBadgeModel IgnoreBadge = new ChartBadgeModel() | |
| 30 | 新增: { | |
| 31 | 新增: Name = "忽略", | |
| 32 | 新增: Color = "#f51837", | |
| 33 | 新增: Type = ChartBadgeType.Ignore | |
| 34 | 新增: }; | |
| 35 | 新增: } | |
| 36 | 新增:} | |
| @@ -0,0 +1,20 @@ | ||
| 1 | 新增:using System; | |
| 2 | 新增:using System.Collections.Generic; | |
| 3 | 新增:using System.Linq; | |
| 4 | 新增:using System.Text; | |
| 5 | 新增:using System.Threading.Tasks; | |
| 6 | 新增: | |
| 7 | 新增:namespace UI.Controls.Charts.Model | |
| 8 | 新增:{ | |
| 9 | 新增: public enum ChartBadgeType | |
| 10 | 新增: { | |
| 11 | 新增: /// <summary> | |
| 12 | 新增: /// 应用分类 | |
| 13 | 新增: /// </summary> | |
| 14 | 新增: Category, | |
| 15 | 新增: /// <summary> | |
| 16 | 新增: /// 忽略徽章 | |
| 17 | 新增: /// </summary> | |
| 18 | 新增: Ignore | |
| 19 | 新增: } | |
| 20 | 新增:} | |
| @@ -3,10 +3,11 @@ using System.Collections.Generic; | ||
| 3 | 3 | using System.Linq; |
| 4 | 4 | using System.Text; |
| 5 | 5 | using System.Threading.Tasks; |
| 6 | 新增:using UI.Models; | |
| 6 | 7 | |
| 7 | 8 | namespace UI.Controls.Charts.Model |
| 8 | 9 | { |
| 9 | 删除: public class ChartsDataModel | |
| 10 | 新增: public class ChartsDataModel : UINotifyPropertyChanged | |
| 10 | 11 | { |
| 11 | 12 | /// <summary> |
| 12 | 13 | /// 名称 |
| @@ -56,5 +57,11 @@ namespace UI.Controls.Charts.Model | ||
| 56 | 57 | /// 颜色 |
| 57 | 58 | /// </summary> |
| 58 | 59 | public string Color { get; set; } |
| 60 | 新增: | |
| 61 | 新增: private List<ChartBadgeModel> BadgeList_; | |
| 62 | 新增: /// <summary> | |
| 63 | 新增: /// 徽章 | |
| 64 | 新增: /// </summary> | |
| 65 | 新增: public List<ChartBadgeModel> BadgeList { get { return BadgeList_; } set { BadgeList_ = value; OnPropertyChanged(); } } | |
| 59 | 66 | } |
| 60 | 67 | } |
| @@ -1,7 +1,9 @@ | ||
| 1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | 3 | xmlns:local="clr-namespace:UI.Controls.Charts" |
| 4 | 删除: xmlns:base="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: xmlns:base="clr-namespace:UI.Controls.Base" xmlns:converter="clr-namespace:UI.Controls.Converters"> | |
| 5 | 新增: <converter:HextoColorConverter x:Key="HextoColorConverter"/> | |
| 6 | 新增: | |
| 5 | 7 | <Style TargetType="{x:Type local:ChartsItemTypeA}"> |
| 6 | 8 | <Setter Property="SnapsToDevicePixels" |
| 7 | 9 | Value="true" /> |
| @@ -51,7 +53,68 @@ | ||
| 51 | 53 | </Grid> |
| 52 | 54 | </Grid>--> |
| 53 | 55 | <StackPanel Grid.Column="1" x:Name="ValueContainer" VerticalAlignment="Center" > |
| 54 | 删除: <TextBlock x:Name="NameTextObj" Foreground="{DynamicResource StandardTextBrush}" HorizontalAlignment="Left"/> | |
| 56 | 新增: <Grid> | |
| 57 | 新增: <Grid.ColumnDefinitions> | |
| 58 | 新增: <ColumnDefinition Width="auto"/> | |
| 59 | 新增: <ColumnDefinition Width="auto"/> | |
| 60 | 新增: </Grid.ColumnDefinitions> | |
| 61 | 新增: <TextBlock x:Name="NameTextObj" Foreground="{DynamicResource StandardTextBrush}" HorizontalAlignment="Left" VerticalAlignment="Center" /> | |
| 62 | 新增: | |
| 63 | 新增: <ListView x:Name="BadgeListView" Visibility="Collapsed" Grid.Column="1" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeA}}, Path=Data.BadgeList}" Margin="0,0,0,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > | |
| 64 | 新增: | |
| 65 | 新增: <ListBox.Resources> | |
| 66 | 新增: <Style TargetType="{x:Type ListView}"> | |
| 67 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 68 | 新增: | |
| 69 | 新增: <Setter Property="Template"> | |
| 70 | 新增: <Setter.Value> | |
| 71 | 新增: <ControlTemplate TargetType="{x:Type ListView}"> | |
| 72 | 新增: <Border> | |
| 73 | 新增: <ItemsPresenter /> | |
| 74 | 新增: </Border> | |
| 75 | 新增: </ControlTemplate> | |
| 76 | 新增: </Setter.Value> | |
| 77 | 新增: </Setter> | |
| 78 | 新增: </Style> | |
| 79 | 新增: <Style TargetType="{x:Type ListViewItem}"> | |
| 80 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 81 | 新增: <Setter Property="Foreground" Value="White"/> | |
| 82 | 新增: | |
| 83 | 新增: <Setter Property="Template"> | |
| 84 | 新增: <Setter.Value> | |
| 85 | 新增: <ControlTemplate TargetType="{x:Type ListViewItem}"> | |
| 86 | 新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{Binding Color,Converter={StaticResource HextoColorConverter}}" Margin="5,0,0,0" Padding="6,4" CornerRadius="6"> | |
| 87 | 新增: <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| 88 | 新增: </Border> | |
| 89 | 新增: <ControlTemplate.Triggers> | |
| 90 | 新增: </ControlTemplate.Triggers> | |
| 91 | 新增: </ControlTemplate> | |
| 92 | 新增: </Setter.Value> | |
| 93 | 新增: </Setter> | |
| 94 | 新增: | |
| 95 | 新增: </Style> | |
| 96 | 新增: </ListBox.Resources> | |
| 97 | 新增: <ListBox.ItemsPanel> | |
| 98 | 新增: <ItemsPanelTemplate> | |
| 99 | 新增: <WrapPanel/> | |
| 100 | 新增: </ItemsPanelTemplate> | |
| 101 | 新增: </ListBox.ItemsPanel> | |
| 102 | 新增: <ListView.ItemTemplate> | |
| 103 | 新增: <DataTemplate> | |
| 104 | 新增: | |
| 105 | 新增: <WrapPanel Orientation="Horizontal"> | |
| 106 | 新增: <Border > | |
| 107 | 新增: <TextBlock Text="{Binding Name}" FontSize="10"/> | |
| 108 | 新增: </Border> | |
| 109 | 新增: | |
| 110 | 新增: </WrapPanel> | |
| 111 | 新增: | |
| 112 | 新增: </DataTemplate> | |
| 113 | 新增: </ListView.ItemTemplate> | |
| 114 | 新增: </ListView> | |
| 115 | 新增: | |
| 116 | 新增: | |
| 117 | 新增: </Grid> | |
| 55 | 118 | <StackPanel Orientation="Horizontal" > |
| 56 | 119 | <Rectangle |
| 57 | 120 | x:Name="ValueBlockObj" |
| @@ -154,6 +217,9 @@ | ||
| 154 | 217 | <Setter TargetName="Loading" Property="Visibility" Value="Visible"/> |
| 155 | 218 | <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/> |
| 156 | 219 | </Trigger> |
| 220 | 新增: <Trigger Property="IsShowBadge" Value="True"> | |
| 221 | 新增: <Setter TargetName="BadgeListView" Property="Visibility" Value="Visible"/> | |
| 222 | 新增: </Trigger> | |
| 157 | 223 | </ControlTemplate.Triggers> |
| 158 | 224 | </ControlTemplate> |
| 159 | 225 | </Setter.Value> |
| @@ -1,7 +1,9 @@ | ||
| 1 | 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | 3 | xmlns:local="clr-namespace:UI.Controls.Charts" |
| 4 | 删除: xmlns:base="clr-namespace:UI.Controls.Base"> | |
| 4 | 新增: xmlns:base="clr-namespace:UI.Controls.Base" xmlns:converter="clr-namespace:UI.Controls.Converters"> | |
| 5 | 新增: <converter:HextoColorConverter x:Key="HextoColorConverter"/> | |
| 6 | 新增: | |
| 5 | 7 | <Style TargetType="{x:Type local:ChartsItemTypeA}"> |
| 6 | 8 | <Setter Property="SnapsToDevicePixels" |
| 7 | 9 | Value="true" /> |
| @@ -51,7 +53,68 @@ | ||
| 51 | 53 | </Grid> |
| 52 | 54 | </Grid>--> |
| 53 | 55 | <StackPanel Grid.Column="1" x:Name="ValueContainer" VerticalAlignment="Center" > |
| 54 | 删除: <TextBlock x:Name="NameTextObj" Foreground="#5c5c5c" HorizontalAlignment="Left"/> | |
| 56 | 新增: <Grid> | |
| 57 | 新增: <Grid.ColumnDefinitions> | |
| 58 | 新增: <ColumnDefinition Width="auto"/> | |
| 59 | 新增: <ColumnDefinition Width="auto"/> | |
| 60 | 新增: </Grid.ColumnDefinitions> | |
| 61 | 新增: <TextBlock x:Name="NameTextObj" Foreground="#5c5c5c" HorizontalAlignment="Left" VerticalAlignment="Center" /> | |
| 62 | 新增: | |
| 63 | 新增: <ListView x:Name="BadgeListView" Visibility="Collapsed" Grid.Column="1" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeA}}, Path=Data.BadgeList}" Margin="0,0,0,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > | |
| 64 | 新增: | |
| 65 | 新增: <ListBox.Resources> | |
| 66 | 新增: <Style TargetType="{x:Type ListView}"> | |
| 67 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 68 | 新增: | |
| 69 | 新增: <Setter Property="Template"> | |
| 70 | 新增: <Setter.Value> | |
| 71 | 新增: <ControlTemplate TargetType="{x:Type ListView}"> | |
| 72 | 新增: <Border> | |
| 73 | 新增: <ItemsPresenter /> | |
| 74 | 新增: </Border> | |
| 75 | 新增: </ControlTemplate> | |
| 76 | 新增: </Setter.Value> | |
| 77 | 新增: </Setter> | |
| 78 | 新增: </Style> | |
| 79 | 新增: <Style TargetType="{x:Type ListViewItem}"> | |
| 80 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 81 | 新增: <Setter Property="Foreground" Value="White"/> | |
| 82 | 新增: | |
| 83 | 新增: <Setter Property="Template"> | |
| 84 | 新增: <Setter.Value> | |
| 85 | 新增: <ControlTemplate TargetType="{x:Type ListViewItem}"> | |
| 86 | 新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{Binding Color,Converter={StaticResource HextoColorConverter}}" Margin="5,0,0,0" Padding="6,4" CornerRadius="6"> | |
| 87 | 新增: <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| 88 | 新增: </Border> | |
| 89 | 新增: <ControlTemplate.Triggers> | |
| 90 | 新增: </ControlTemplate.Triggers> | |
| 91 | 新增: </ControlTemplate> | |
| 92 | 新增: </Setter.Value> | |
| 93 | 新增: </Setter> | |
| 94 | 新增: | |
| 95 | 新增: </Style> | |
| 96 | 新增: </ListBox.Resources> | |
| 97 | 新增: <ListBox.ItemsPanel> | |
| 98 | 新增: <ItemsPanelTemplate> | |
| 99 | 新增: <WrapPanel/> | |
| 100 | 新增: </ItemsPanelTemplate> | |
| 101 | 新增: </ListBox.ItemsPanel> | |
| 102 | 新增: <ListView.ItemTemplate> | |
| 103 | 新增: <DataTemplate> | |
| 104 | 新增: | |
| 105 | 新增: <WrapPanel Orientation="Horizontal"> | |
| 106 | 新增: <Border > | |
| 107 | 新增: <TextBlock Text="{Binding Name}" FontSize="10"/> | |
| 108 | 新增: </Border> | |
| 109 | 新增: | |
| 110 | 新增: </WrapPanel> | |
| 111 | 新增: | |
| 112 | 新增: </DataTemplate> | |
| 113 | 新增: </ListView.ItemTemplate> | |
| 114 | 新增: </ListView> | |
| 115 | 新增: | |
| 116 | 新增: | |
| 117 | 新增: </Grid> | |
| 55 | 118 | <StackPanel Orientation="Horizontal" > |
| 56 | 119 | <Rectangle |
| 57 | 120 | x:Name="ValueBlockObj" |
| @@ -108,7 +171,7 @@ | ||
| 108 | 171 | <VisualState x:Name="NormalState" /> |
| 109 | 172 | <VisualState x:Name="MouseOver"> |
| 110 | 173 | <Storyboard > |
| 111 | 删除: | |
| 174 | 新增: | |
| 112 | 175 | <ColorAnimation Storyboard.TargetProperty="(Rectangle.Fill).(SolidColorBrush.Color)" |
| 113 | 176 | Storyboard.TargetName="ValueBlockObj" To="{DynamicResource ThemeColor}" > |
| 114 | 177 | <ColorAnimation.EasingFunction> |
| @@ -143,6 +206,9 @@ | ||
| 143 | 206 | <Setter TargetName="Loading" Property="Visibility" Value="Visible"/> |
| 144 | 207 | <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/> |
| 145 | 208 | </Trigger> |
| 209 | 新增: <Trigger Property="IsShowBadge" Value="True"> | |
| 210 | 新增: <Setter TargetName="BadgeListView" Property="Visibility" Value="Visible"/> | |
| 211 | 新增: </Trigger> | |
| 146 | 212 | </ControlTemplate.Triggers> |
| 147 | 213 | </ControlTemplate> |
| 148 | 214 | </Setter.Value> |
| @@ -80,6 +80,12 @@ namespace UI.Servicers | ||
| 80 | 80 | { |
| 81 | 81 | app = (data.Data as HoursLogModel).AppModel; |
| 82 | 82 | } |
| 83 | 新增: var newBadgeList = new List<ChartBadgeModel>(); | |
| 84 | 新增: if (data.BadgeList != null) | |
| 85 | 新增: { | |
| 86 | 新增: var categoryBadge = data.BadgeList.Where(m => m.Type != ChartBadgeType.Ignore).ToList(); | |
| 87 | 新增: newBadgeList.AddRange(categoryBadge); | |
| 88 | 新增: } | |
| 83 | 89 | |
| 84 | 90 | var config = appConfig.GetConfig(); |
| 85 | 91 | if (config.Behavior.IgnoreProcessList.Contains(app.Name)) |
| @@ -91,7 +97,10 @@ namespace UI.Servicers | ||
| 91 | 97 | { |
| 92 | 98 | config.Behavior.IgnoreProcessList.Add(app.Name); |
| 93 | 99 | main.Toast($"已忽略此应用 {app.Description}", Controls.Window.ToastType.Success); |
| 100 | 新增: | |
| 101 | 新增: newBadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 94 | 102 | } |
| 103 | 新增: data.BadgeList = newBadgeList; | |
| 95 | 104 | } |
| 96 | 105 | |
| 97 | 106 | private void SetCategory_ContextMenuOpening(object sender, ContextMenuEventArgs e) |
| @@ -143,7 +152,7 @@ namespace UI.Servicers | ||
| 143 | 152 | categoryMenu.IsChecked = app.CategoryID == category.ID; |
| 144 | 153 | categoryMenu.Click += (s, e) => |
| 145 | 154 | { |
| 146 | 删除: SetAppCategory(app.ID, category); | |
| 155 | 新增: SetAppCategory(data, app.ID, category); | |
| 147 | 156 | }; |
| 148 | 157 | setCategory.Items.Add(categoryMenu); |
| 149 | 158 | } |
| @@ -201,8 +210,24 @@ namespace UI.Servicers | ||
| 201 | 210 | main.Toast("关联配置不存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.Blocked); |
| 202 | 211 | } |
| 203 | 212 | } |
| 204 | 删除: private void SetAppCategory(int appId, CategoryModel category) | |
| 213 | 新增: private void SetAppCategory(ChartsDataModel data, int appId, CategoryModel category) | |
| 205 | 214 | { |
| 215 | 新增: var newBadgeList = new List<ChartBadgeModel>(); | |
| 216 | 新增: if (data.BadgeList != null) | |
| 217 | 新增: { | |
| 218 | 新增: var otherBadge = data.BadgeList.Where(m => m.Type != ChartBadgeType.Category).ToList(); | |
| 219 | 新增: newBadgeList.AddRange(otherBadge); | |
| 220 | 新增: } | |
| 221 | 新增: | |
| 222 | 新增: newBadgeList.Add(new ChartBadgeModel() | |
| 223 | 新增: { | |
| 224 | 新增: Name = category.Name, | |
| 225 | 新增: Color = category.Color, | |
| 226 | 新增: Type = ChartBadgeType.Category | |
| 227 | 新增: }); | |
| 228 | 新增: | |
| 229 | 新增: data.BadgeList = newBadgeList; | |
| 230 | 新增: | |
| 206 | 231 | var app = appData.GetApp(appId); |
| 207 | 232 | app.CategoryID = category.ID; |
| 208 | 233 | app.Category = category; |
| @@ -12,11 +12,13 @@ namespace UI.Servicers | ||
| 12 | 12 | private readonly IMain main; |
| 13 | 13 | private readonly IThemeServicer themeServicer; |
| 14 | 14 | private readonly IInputServicer inputServicer; |
| 15 | 删除: public MainServicer(IMain main, IThemeServicer themeServicer, IInputServicer inputServicer) | |
| 15 | 新增: private readonly IAppContextMenuServicer appContextMenuServicer; | |
| 16 | 新增: public MainServicer(IMain main, IThemeServicer themeServicer, IInputServicer inputServicer, IAppContextMenuServicer appContextMenuServicer) | |
| 16 | 17 | { |
| 17 | 18 | this.main = main; |
| 18 | 19 | this.themeServicer = themeServicer; |
| 19 | 20 | this.inputServicer = inputServicer; |
| 21 | 新增: this.appContextMenuServicer = appContextMenuServicer; | |
| 20 | 22 | } |
| 21 | 23 | public void Start() |
| 22 | 24 | { |
| @@ -28,6 +30,7 @@ namespace UI.Servicers | ||
| 28 | 30 | { |
| 29 | 31 | themeServicer.Init(); |
| 30 | 32 | inputServicer.Start(); |
| 33 | 新增: appContextMenuServicer.Init(); | |
| 31 | 34 | } |
| 32 | 35 | } |
| 33 | 36 | } |
| @@ -51,7 +51,68 @@ | ||
| 51 | 51 | </Grid> |
| 52 | 52 | </Grid>--> |
| 53 | 53 | <StackPanel Grid.Column="1" x:Name="ValueContainer" VerticalAlignment="Center" > |
| 54 | 删除: <TextBlock x:Name="NameTextObj" Foreground="#5c5c5c" HorizontalAlignment="Left"/> | |
| 54 | 新增: <Grid> | |
| 55 | 新增: <Grid.ColumnDefinitions> | |
| 56 | 新增: <ColumnDefinition Width="auto"/> | |
| 57 | 新增: <ColumnDefinition Width="auto"/> | |
| 58 | 新增: </Grid.ColumnDefinitions> | |
| 59 | 新增: <TextBlock x:Name="NameTextObj" Foreground="#5c5c5c" HorizontalAlignment="Left" VerticalAlignment="Center" /> | |
| 60 | 新增: | |
| 61 | 新增: <ListView x:Name="BadgeListView" Visibility="Collapsed" Grid.Column="1" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ChartsItemTypeA}}, Path=Data.BadgeList}" Margin="0,0,0,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > | |
| 62 | 新增: | |
| 63 | 新增: <ListBox.Resources> | |
| 64 | 新增: <Style TargetType="{x:Type ListView}"> | |
| 65 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 66 | 新增: | |
| 67 | 新增: <Setter Property="Template"> | |
| 68 | 新增: <Setter.Value> | |
| 69 | 新增: <ControlTemplate TargetType="{x:Type ListView}"> | |
| 70 | 新增: <Border> | |
| 71 | 新增: <ItemsPresenter /> | |
| 72 | 新增: </Border> | |
| 73 | 新增: </ControlTemplate> | |
| 74 | 新增: </Setter.Value> | |
| 75 | 新增: </Setter> | |
| 76 | 新增: </Style> | |
| 77 | 新增: <Style TargetType="{x:Type ListViewItem}"> | |
| 78 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 79 | 新增: <Setter Property="Foreground" Value="White"/> | |
| 80 | 新增: | |
| 81 | 新增: <Setter Property="Template"> | |
| 82 | 新增: <Setter.Value> | |
| 83 | 新增: <ControlTemplate TargetType="{x:Type ListViewItem}"> | |
| 84 | 新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{Binding Color,Converter={StaticResource HextoColorConverter}}" Margin="5,0,0,0" Padding="6,4" CornerRadius="6"> | |
| 85 | 新增: <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/> | |
| 86 | 新增: </Border> | |
| 87 | 新增: <ControlTemplate.Triggers> | |
| 88 | 新增: </ControlTemplate.Triggers> | |
| 89 | 新增: </ControlTemplate> | |
| 90 | 新增: </Setter.Value> | |
| 91 | 新增: </Setter> | |
| 92 | 新增: | |
| 93 | 新增: </Style> | |
| 94 | 新增: </ListBox.Resources> | |
| 95 | 新增: <ListBox.ItemsPanel> | |
| 96 | 新增: <ItemsPanelTemplate> | |
| 97 | 新增: <WrapPanel/> | |
| 98 | 新增: </ItemsPanelTemplate> | |
| 99 | 新增: </ListBox.ItemsPanel> | |
| 100 | 新增: <ListView.ItemTemplate> | |
| 101 | 新增: <DataTemplate> | |
| 102 | 新增: | |
| 103 | 新增: <WrapPanel Orientation="Horizontal"> | |
| 104 | 新增: <Border > | |
| 105 | 新增: <TextBlock Text="{Binding Name}" FontSize="10"/> | |
| 106 | 新增: </Border> | |
| 107 | 新增: | |
| 108 | 新增: </WrapPanel> | |
| 109 | 新增: | |
| 110 | 新增: </DataTemplate> | |
| 111 | 新增: </ListView.ItemTemplate> | |
| 112 | 新增: </ListView> | |
| 113 | 新增: | |
| 114 | 新增: | |
| 115 | 新增: </Grid> | |
| 55 | 116 | <StackPanel Orientation="Horizontal" > |
| 56 | 117 | <Rectangle |
| 57 | 118 | x:Name="ValueBlockObj" |
| @@ -142,6 +203,9 @@ | ||
| 142 | 203 | <Setter TargetName="Loading" Property="Visibility" Value="Visible"/> |
| 143 | 204 | <Setter TargetName="Normal" Property="Visibility" Value="Hidden"/> |
| 144 | 205 | </Trigger> |
| 206 | 新增: <Trigger Property="IsShowBadge" Value="True"> | |
| 207 | 新增: <Setter TargetName="BadgeListView" Property="Visibility" Value="Visible"/> | |
| 208 | 新增: </Trigger> | |
| 145 | 209 | </ControlTemplate.Triggers> |
| 146 | 210 | </ControlTemplate> |
| 147 | 211 | </Setter.Value> |
| @@ -148,6 +148,8 @@ | ||
| 148 | 148 | <Compile Include="Controls\Charts\ChartsItemTypeA.cs" /> |
| 149 | 149 | <Compile Include="Controls\Charts\Charts.cs" /> |
| 150 | 150 | <Compile Include="Controls\Charts\ChartsType.cs" /> |
| 151 | 新增: <Compile Include="Controls\Charts\Model\ChartBadgeModel.cs" /> | |
| 152 | 新增: <Compile Include="Controls\Charts\Model\ChartBadgeType.cs" /> | |
| 151 | 153 | <Compile Include="Controls\Charts\Model\ChartColumnInfoModel.cs" /> |
| 152 | 154 | <Compile Include="Controls\Charts\Model\ChartsDataModel.cs" /> |
| 153 | 155 | <Compile Include="Controls\Converters\ToStringConverter.cs" /> |
| @@ -24,12 +24,14 @@ namespace UI.ViewModels | ||
| 24 | 24 | private readonly IData data; |
| 25 | 25 | private readonly MainViewModel main; |
| 26 | 26 | private readonly IAppContextMenuServicer appContextMenuServicer; |
| 27 | 新增: private readonly IAppConfig appConfig; | |
| 27 | 28 | |
| 28 | 删除: public DataPageVM(IData data, MainViewModel main, IAppContextMenuServicer appContextMenuServicer) | |
| 29 | 新增: public DataPageVM(IData data, MainViewModel main, IAppContextMenuServicer appContextMenuServicer, IAppConfig appConfig) | |
| 29 | 30 | { |
| 30 | 31 | this.data = data; |
| 31 | 32 | this.main = main; |
| 32 | 33 | this.appContextMenuServicer = appContextMenuServicer; |
| 34 | 新增: this.appConfig = appConfig; | |
| 33 | 35 | |
| 34 | 36 | ToDetailCommand = new Command(new Action<object>(OnTodetailCommand)); |
| 35 | 37 | |
| @@ -180,10 +182,10 @@ namespace UI.ViewModels | ||
| 180 | 182 | private List<ChartsDataModel> MapToChartsData(IEnumerable<Core.Models.DailyLogModel> list) |
| 181 | 183 | { |
| 182 | 184 | var resData = new List<ChartsDataModel>(); |
| 185 | 新增: var config = appConfig.GetConfig(); | |
| 183 | 186 | |
| 184 | 187 | foreach (var item in list) |
| 185 | 188 | { |
| 186 | 删除: | |
| 187 | 189 | var bindModel = new ChartsDataModel(); |
| 188 | 190 | bindModel.Data = item; |
| 189 | 191 | bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description; |
| @@ -191,6 +193,20 @@ namespace UI.ViewModels | ||
| 191 | 193 | bindModel.Tag = Time.ToString(item.Time); |
| 192 | 194 | bindModel.PopupText = item.AppModel?.File; |
| 193 | 195 | bindModel.Icon = item.AppModel?.IconFile; |
| 196 | 新增: bindModel.BadgeList = new List<ChartBadgeModel>(); | |
| 197 | 新增: if (item.AppModel.Category != null) | |
| 198 | 新增: { | |
| 199 | 新增: bindModel.BadgeList.Add(new ChartBadgeModel() | |
| 200 | 新增: { | |
| 201 | 新增: Name = item.AppModel.Category.Name, | |
| 202 | 新增: Color = item.AppModel.Category.Color, | |
| 203 | 新增: Type = ChartBadgeType.Category | |
| 204 | 新增: }); | |
| 205 | 新增: } | |
| 206 | 新增: if (config.Behavior.IgnoreProcessList.Contains(item.AppModel.Name)) | |
| 207 | 新增: { | |
| 208 | 新增: bindModel.BadgeList.Add(ChartBadgeModel.IgnoreBadge); | |
| 209 | 新增: } | |
| 194 | 210 | resData.Add(bindModel); |
| 195 | 211 | } |
| 196 | 212 | |
| @@ -66,7 +66,6 @@ namespace UI.ViewModels | ||
| 66 | 66 | PropertyChanged += IndexPageVM_PropertyChanged; |
| 67 | 67 | LoadThisWeekData(); |
| 68 | 68 | |
| 69 | 删除: appContextMenuServicer.Init(); | |
| 70 | 69 | AppContextMenu = appContextMenuServicer.GetContextMenu(); |
| 71 | 70 | |
| 72 | 71 | inputServicer.OnKeyUpInput += InputServicer_OnKeyUpInput; |
| @@ -49,7 +49,7 @@ | ||
| 49 | 49 | <select:DateSelect Date="{Binding DayDate,Mode=TwoWay}"/> |
| 50 | 50 | <!--<DatePickerBar:DatePickerBar SelectedDate="{Binding DayDate,Mode=TwoWay}" ShowType="Day"/>--> |
| 51 | 51 | |
| 52 | 删除: <Charts:Charts IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding Data}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 52 | 新增: <Charts:Charts IsShowBadge="True" IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding Data}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 53 | 53 | </Grid> |
| 54 | 54 | </TabItem> |
| 55 | 55 | <TabItem> |
| @@ -61,7 +61,7 @@ | ||
| 61 | 61 | </Grid.RowDefinitions> |
| 62 | 62 | <!--<DatePickerBar:DatePickerBar SelectedDate="{Binding MonthDate,Mode=TwoWay}" ShowType="Month"/>--> |
| 63 | 63 | <select:DateSelect Date="{Binding MonthDate,Mode=TwoWay}" SelectType="Month"/> |
| 64 | 删除: <Charts:Charts IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding MonthData}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 64 | 新增: <Charts:Charts IsShowBadge="True" IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding MonthData}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 65 | 65 | </Grid> |
| 66 | 66 | </TabItem> |
| 67 | 67 | <TabItem> |
| @@ -74,7 +74,7 @@ | ||
| 74 | 74 | <!--<DatePickerBar:DatePickerBar SelectedDate="{Binding YearDate,Mode=TwoWay}" ShowType="Year"/>--> |
| 75 | 75 | <select:DateSelect Date="{Binding YearDate,Mode=TwoWay}" SelectType="Year"/> |
| 76 | 76 | |
| 77 | 删除: <Charts:Charts IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding YearData}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 77 | 新增: <Charts:Charts IsShowBadge="True" IsSearch="True" Grid.Row="1" ItemMenu="{Binding AppContextMenu}" Data="{Binding YearData}" ChartsType="HorizontalA" Margin="0,20,0,0" ClickCommand="{Binding ToDetailCommand}"/> | |
| 78 | 78 | </Grid> |
| 79 | 79 | </TabItem> |
| 80 | 80 | </TabControl> |

