跳到主要内容

github/tai

公开

Tai · Windows 软件与网站使用时长统计。上游 Planshit/Tai 的源码镜像,非灵栈原创;MIT 许可。来源:https://github.com/Planshit/Tai 。本次为手动同步,暂不提供安装包。

提交记录
修改Core/Models/CategoryModel.cs+4 −0看文件
@@ -24,5 +24,9 @@ namespace Core.Models
2424 /// 分类图标路径
2525 /// </summary>
2626 public string IconFile { get; set; }
27新增: /// <summary>
28新增: /// 颜色
29新增: /// </summary>
30新增: public string Color { get; set; }
2731 }
2832}
修改Core/Properties/AssemblyInfo.cs+2 −2看文件
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
3232//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
3333//通过使用 "*",如下所示:
3434// [assembly: AssemblyVersion("1.0.*")]
35删除:[assembly: AssemblyVersion("1.0.0.3")]
36删除:[assembly: AssemblyFileVersion("1.0.0.1")]
35新增:[assembly: AssemblyVersion("1.0.0.4")]
36新增:[assembly: AssemblyFileVersion("1.0.0.4")]
修改Core/Servicers/Instances/Categorys.cs+1 −0看文件
@@ -90,6 +90,7 @@ namespace Core.Servicers.Instances
9090 {
9191 model.IconFile = item.IconFile;
9292 model.Name = item.Name;
93新增: model.Color = item.Color;
9394 }
9495 }
9596 db.SaveChanges();
新增UI/Controls/Base/ColorSelect.cs+198 −0看文件
@@ -0,0 +1,198 @@
1新增:using Core.Librarys;
2新增:using System;
3新增:using System.Collections.Generic;
4新增:using System.Linq;
5新增:using System.Text;
6新增:using System.Threading.Tasks;
7新增:using System.Windows;
8新增:using System.Windows.Controls;
9新增:using System.Windows.Input;
10新增:
11新增:namespace UI.Controls.Base
12新增:{
13新增: public class ColorSelect : Control
14新增: {
15新增: public List<string> Colors
16新增: {
17新增: get { return (List<string>)GetValue(ColorsProperty); }
18新增: set { SetValue(ColorsProperty, value); }
19新增: }
20新增: public static readonly DependencyProperty ColorsProperty =
21新增: DependencyProperty.Register("Colors",
22新增: typeof(List<string>),
23新增: typeof(ColorSelect)
24新增: );
25新增:
26新增:
27新增: public string Color
28新增: {
29新增: get { return (string)GetValue(ColorProperty); }
30新增: set { SetValue(ColorProperty, value); }
31新增: }
32新增: public static readonly DependencyProperty ColorProperty =
33新增: DependencyProperty.Register("Color",
34新增: typeof(string),
35新增: typeof(ColorSelect), new PropertyMetadata(new PropertyChangedCallback(OnColorPropertyChanged)));
36新增:
37新增: private static void OnColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
38新增: {
39新增: var control = d as ColorSelect;
40新增: if (string.IsNullOrEmpty(control.Color))
41新增: {
42新增: control.Color = control.Colors[0];
43新增: }
44新增: }
45新增:
46新增: public bool IsOpen
47新增: {
48新增: get { return (bool)GetValue(IsOpenProperty); }
49新增: set { SetValue(IsOpenProperty, value); }
50新增: }
51新增: public static readonly DependencyProperty IsOpenProperty =
52新增: DependencyProperty.Register("IsOpen",
53新增: typeof(bool),
54新增: typeof(ColorSelect), new PropertyMetadata(new PropertyChangedCallback(OnPropertyChanged)));
55新增:
56新增: private static void OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
57新增: {
58新增: var control = d as ColorSelect;
59新增: if (e.Property == IsOpenProperty)
60新增: {
61新增: control.HandleHook();
62新增: }
63新增: }
64新增: private Win32API.LowLevelKeyboardProc mouseProc;
65新增: private static IntPtr hookMouseID = IntPtr.Zero;
66新增: private IntPtr hook;
67新增: private bool IsFirstClick = false;
68新增: private Border SelectContainer;
69新增:
70新增:
71新增: #region hook
72新增: private void HandleHook()
73新增: {
74新增: if (IsOpen)
75新增: {
76新增: // 设置键盘钩子
77新增: hook = Win32API.SetMouseHook(mouseProc);
78新增: }
79新增: else
80新增: {
81新增: Win32API.UnhookWindowsHookEx(hook);
82新增: }
83新增: }
84新增: private IntPtr HookCallback(int nCode, IntPtr wParam, IntPtr lParam)
85新增: {
86新增:
87新增: if (nCode >= 0)
88新增: {
89新增: if (wParam == (IntPtr)Win32API.WM_LBUTTONDBLCLK || wParam == (IntPtr)Win32API.WM_WHEEL)
90新增: {
91新增: if (!IsFirstClick)
92新增: {
93新增: bool isInControl = IsInControl();
94新增:
95新增: if (!isInControl)
96新增: {
97新增: IsOpen = false;
98新增: }
99新增: }
100新增: IsFirstClick = false;
101新增: }
102新增:
103新增: }
104新增:
105新增: return Win32API.CallNextHookEx(hookMouseID, nCode, wParam, lParam);
106新增: }
107新增: private bool IsInControl()
108新增: {
109新增: var p = Mouse.GetPosition(SelectContainer);
110新增: if (p.X < 0 || p.Y < 0 || p.X > SelectContainer.ActualWidth || p.Y > SelectContainer.ActualHeight)
111新增: {
112新增: return false;
113新增: }
114新增:
115新增:
116新增: return true;
117新增: }
118新增: #endregion
119新增:
120新增: public Command ShowSelectCommand { get; set; }
121新增: public Command ColorSelectCommand { get; set; }
122新增:
123新增: public ColorSelect()
124新增: {
125新增: DefaultStyleKey = typeof(ColorSelect);
126新增: ShowSelectCommand = new Command(new Action<object>(OnShowSelect));
127新增: ColorSelectCommand = new Command(new Action<object>(OnColorSelect));
128新增: mouseProc = HookCallback;
129新增:
130新增: Unloaded += ColorSelect_Unloaded;
131新增: LoadColors();
132新增: }
133新增:
134新增: private void LoadColors()
135新增: {
136新增: var list = new List<string>()
137新增: {
138新增: "#00FFAB",
139新增: "#017aff",
140新增: "#6c47ff",
141新增: "#39c0c8",
142新增: "#f96300",
143新增: "#f34971",
144新增: "#ff9382",
145新增: "#f5c900",
146新增: "#cdad7a",
147新增: "#aabb5d",
148新增: "#000000",
149新增: "#2B20D9"
150新增: };
151新增:
152新增:
153新增: Colors = list;
154新增: Color = list[0];
155新增: }
156新增: private void OnShowSelect(object obj)
157新增: {
158新增: IsOpen = true;
159新增: IsFirstClick = true;
160新增: }
161新增:
162新增: private string HexConverter(System.Drawing.Color c)
163新增: {
164新增: return "#" + c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2");
165新增: }
166新增:
167新增: private void OnColorSelect(object obj)
168新增: {
169新增: IsOpen = false;
170新增: IsFirstClick = false;
171新增:
172新增: System.Windows.Forms.ColorDialog colorDialog = new System.Windows.Forms.ColorDialog();
173新增: if (colorDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
174新增: {
175新增: Color = HexConverter(colorDialog.Color);
176新增: }
177新增: }
178新增:
179新增: public override void OnApplyTemplate()
180新增: {
181新增: base.OnApplyTemplate();
182新增:
183新增: SelectContainer = GetTemplateChild("SelectContainer") as Border;
184新增: }
185新增:
186新增: private void ColorSelect_Unloaded(object sender, RoutedEventArgs e)
187新增: {
188新增: Win32API.UnhookWindowsHookEx(hook);
189新增: }
190新增:
191新增: protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
192新增: {
193新增: base.OnMouseLeftButtonDown(e);
194新增: }
195新增:
196新增:
197新增: }
198新增:}
修改UI/Controls/Converters/HextoColorConverter.cs+4 −0看文件
@@ -14,6 +14,10 @@ namespace UI.Controls.Converters
1414 {
1515 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
1616 {
17新增: if(value == null)
18新增: {
19新增: return null;
20新增: }
1721 return UI.Base.Color.Colors.GetFromString(value.ToString());
1822 }
1923
修改UI/Models/CategoryPageModel.cs+3 −0看文件
@@ -55,5 +55,8 @@ namespace UI.Models
5555 }
5656 private bool IsEditError_ = false;
5757 public bool IsEditError { get { return IsEditError_; } set { IsEditError_ = value; OnPropertyChanged(); } }
58新增:
59新增: private string EditColor_;
60新增: public string EditColor { get { return EditColor_; } set { EditColor_ = value; OnPropertyChanged(); } }
5861 }
5962}
文件末尾没有换行
新增UI/Themes/Base/ColorSelect.xaml+133 −0看文件
@@ -0,0 +1,133 @@
1新增:<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2新增: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3新增: xmlns:local="clr-namespace:UI.Controls.Base" xmlns:button="clr-namespace:UI.Controls.Button" xmlns:converter="clr-namespace:UI.Controls.Converters">
4新增: <converter:HextoColorConverter x:Key="HextoColorConverter"/>
5新增:
6新增: <Style TargetType="{x:Type local:ColorSelect}">
7新增: <Setter Property="SnapsToDevicePixels"
8新增: Value="true" />
9新增: <Setter Property="Background" Value="Transparent"/>
10新增:
11新增: <Setter Property="Template">
12新增: <Setter.Value>
13新增: <ControlTemplate TargetType="{x:Type local:ColorSelect}">
14新增: <Border Background="{TemplateBinding Background}" SnapsToDevicePixels="True" BorderBrush="#f7f8fa" CornerRadius="5" BorderThickness="2" Width="38" Height="38">
15新增: <Border.InputBindings>
16新增: <MouseBinding Gesture="LeftClick" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=ShowSelectCommand}"/>
17新增: </Border.InputBindings>
18新增: <Grid>
19新增: <Border CornerRadius="4" Width="28" Height="28" Background="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=Color,Converter={StaticResource HextoColorConverter}}"/>
20新增: <Popup
21新增: x:Name="Popup"
22新增: Placement="Bottom"
23新增: IsOpen="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=IsOpen,Mode=TwoWay}" AllowsTransparency="True"
24新增: >
25新增: <Border
26新增: x:Name="SelectContainer"
27新增: CornerRadius="10"
28新增: BorderBrush="#CCC"
29新增: BorderThickness="1"
30新增: Background="White" Padding="10" Width="275" MaxHeight="300" Margin="10">
31新增: <Border.Effect>
32新增: <DropShadowEffect BlurRadius="6" ShadowDepth="2" Direction="315" Color="Gray" Opacity=".1"/>
33新增: </Border.Effect>
34新增: <Grid>
35新增: <Grid.RowDefinitions>
36新增: <RowDefinition Height="auto"/>
37新增: <RowDefinition Height="*"/>
38新增: <RowDefinition Height="auto"/>
39新增: </Grid.RowDefinitions>
40新增:
41新增: <TextBlock Text="选择颜色" VerticalAlignment="Center" HorizontalAlignment="Left"/>
42新增:
43新增: <ScrollViewer Grid.Row="1">
44新增: <ListView Grid.Row="1" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=Colors}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=Color,Mode=TwoWay}" Margin="0,10,0,0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
45新增: <!--<i:Interaction.Triggers>
46新增: <i:EventTrigger EventName="MouseLeftButtonUp">
47新增: <i:InvokeCommandAction Command="{Binding GotoDetailCommand}"
48新增: CommandParameter="{Binding SelectedItem}" />
49新增: </i:EventTrigger>
50新增: </i:Interaction.Triggers>-->
51新增: <ListBox.Resources>
52新增: <Style TargetType="{x:Type ListView}">
53新增: <Setter Property="OverridesDefaultStyle" Value="True"/>
54新增:
55新增: <Setter Property="Template">
56新增: <Setter.Value>
57新增: <ControlTemplate TargetType="{x:Type ListView}">
58新增: <Border>
59新增: <ItemsPresenter />
60新增: </Border>
61新增: </ControlTemplate>
62新增: </Setter.Value>
63新增: </Setter>
64新增: </Style>
65新增: <Style TargetType="{x:Type ListViewItem}">
66新增: <Setter Property="OverridesDefaultStyle" Value="True"/>
67新增: <Setter Property="Foreground" Value="#1a1a1a"/>
68新增:
69新增: <Setter Property="Template">
70新增: <Setter.Value>
71新增: <ControlTemplate TargetType="{x:Type ListViewItem}">
72新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="White" Margin="0,0,0,0" Padding="0" Width="35" Height="35" CornerRadius="5">
73新增: <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
74新增: </Border>
75新增: <ControlTemplate.Triggers>
76新增:
77新增: <Trigger Property="IsMouseOver" Value="True">
78新增: <Setter TargetName="Border" Property="Background" Value="#FFE8E6FF"/>
79新增: <!--<Setter TargetName="Border" Property="BorderBrush" Value="#2b20d9"/>-->
80新增:
81新增: </Trigger>
82新增: <Trigger Property="IsSelected" Value="True">
83新增: <Setter TargetName="Border" Property="BorderBrush" Value="#2b20d9"/>
84新增: <Setter Property="Foreground" Value="White"/>
85新增:
86新增: <!--<Setter TargetName="Border" Property="BorderBrush" Value="#2b20d9"/>-->
87新增:
88新增: </Trigger>
89新增: </ControlTemplate.Triggers>
90新增: </ControlTemplate>
91新增: </Setter.Value>
92新增: </Setter>
93新增:
94新增: </Style>
95新增: </ListBox.Resources>
96新增: <ListBox.ItemsPanel>
97新增: <ItemsPanelTemplate>
98新增: <WrapPanel/>
99新增: </ItemsPanelTemplate>
100新增: </ListBox.ItemsPanel>
101新增: <ListView.ItemTemplate>
102新增: <DataTemplate>
103新增:
104新增: <WrapPanel Orientation="Horizontal">
105新增:
106新增: <!--<local:Img URL="{Binding}" Width="25" Height="25"/>-->
107新增: <Border Width="25" CornerRadius="4" Height="25" Background="{Binding .,Converter={StaticResource HextoColorConverter}}">
108新增: </Border>
109新增:
110新增: </WrapPanel>
111新增:
112新增: </DataTemplate>
113新增: </ListView.ItemTemplate>
114新增: </ListView>
115新增: </ScrollViewer>
116新增: <button:Button Grid.Row="2" HorizontalAlignment="Right" Command="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:ColorSelect}}, Path=ColorSelectCommand}" Content="自定义颜色" Width="120"/>
117新增: </Grid>
118新增: </Border>
119新增:
120新增: </Popup>
121新增: </Grid>
122新增: </Border>
123新增: <ControlTemplate.Triggers>
124新增:
125新增: <Trigger Property="IsMouseOver" Value="True">
126新增: <Setter Property="Background" Value="#FFE8E6FF"/>
127新增: </Trigger>
128新增: </ControlTemplate.Triggers>
129新增: </ControlTemplate>
130新增: </Setter.Value>
131新增: </Setter>
132新增: </Style>
133新增:</ResourceDictionary>
文件末尾没有换行
修改UI/Themes/Generic.xaml+1 −0看文件
@@ -13,6 +13,7 @@
1313 <ResourceDictionary Source="/Tai;component/Themes/Base/Text.xaml"/>
1414 <ResourceDictionary Source="/Tai;component/Themes/Base/View.xaml"/>
1515 <ResourceDictionary Source="/Tai;component/Themes/Base/IconSelect.xaml"/>
16新增: <ResourceDictionary Source="/Tai;component/Themes/Base/ColorSelect.xaml"/>
1617
1718 <ResourceDictionary Source="/Tai;component/Themes/PageContainer.xaml"/>
1819 <ResourceDictionary Source="/Tai;component/Themes/Charts/Charts.xaml"/>
修改UI/UI.csproj+5 −0看文件
@@ -129,6 +129,7 @@
129129 <Compile Include="Base\Color\ColorTypes.cs" />
130130 <Compile Include="Controls\Base\EmptyData.cs" />
131131 <Compile Include="Controls\Base\CheckBox.cs" />
132新增: <Compile Include="Controls\Base\ColorSelect.cs" />
132133 <Compile Include="Controls\Base\IconSelect.cs" />
133134 <Compile Include="Controls\Base\Img.cs" />
134135 <Compile Include="Controls\Base\Placeholder.cs" />
@@ -240,6 +241,10 @@
240241 <Generator>MSBuild:Compile</Generator>
241242 <SubType>Designer</SubType>
242243 </Page>
244新增: <Page Include="Themes\Base\ColorSelect.xaml">
245新增: <Generator>MSBuild:Compile</Generator>
246新增: <SubType>Designer</SubType>
247新增: </Page>
243248 <Page Include="Themes\Base\IconSelect.xaml">
244249 <Generator>MSBuild:Compile</Generator>
245250 <SubType>Designer</SubType>
修改UI/ViewModels/CategoryPageVM.cs+7 −2看文件
@@ -107,7 +107,7 @@ namespace UI.ViewModels
107107 mainVM.Toast("请选择一个分类图标", Controls.Window.ToastType.Error, Controls.Base.IconTypes.CriticalErrorSolid);
108108 return;
109109 }
110删除: if (EditIconFile.IndexOf("pack://") ==-1 && new FileInfo(EditIconFile).Length > 1000000)
110新增: if (EditIconFile.IndexOf("pack://") == -1 && new FileInfo(EditIconFile).Length > 1000000)
111111 {
112112 mainVM.Toast("图标文件不能超过1MB", Controls.Window.ToastType.Error, Controls.Base.IconTypes.CriticalErrorSolid);
113113 return;
@@ -132,6 +132,7 @@ namespace UI.ViewModels
132132 {
133133 Name = EditName,
134134 IconFile = EditIconFile,
135新增: Color = EditColor,
135136 });
136137
137138 var item = new CategoryModel()
@@ -162,7 +163,7 @@ namespace UI.ViewModels
162163 mainVM.Toast("分类名称已存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.CriticalErrorSolid);
163164 return;
164165 }
165删除: if (EditName == SelectedItem.Data.Name && EditIconFile == SelectedItem.Data.IconFile)
166新增: if (EditName == SelectedItem.Data.Name && EditIconFile == SelectedItem.Data.IconFile && EditColor==SelectedItem.Data.Color)
166167 {
167168 mainVM.Toast("没有修改");
168169 EditVisibility = System.Windows.Visibility.Collapsed;
@@ -175,6 +176,8 @@ namespace UI.ViewModels
175176 {
176177 category.Name = EditName;
177178 category.IconFile = EditIconFile;
179新增: category.Color = EditColor;
180新增:
178181 categorys.Update(category);
179182 categorys.SaveChanged();
180183 }
@@ -189,6 +192,7 @@ namespace UI.ViewModels
189192 ID = item.Data.ID,
190193 Name = EditName,
191194 IconFile = EditIconFile,
195新增: Color = EditColor
192196 }
193197 };
194198
@@ -212,6 +216,7 @@ namespace UI.ViewModels
212216 var select = obj as CategoryModel;
213217 EditName = select.Data.Name;
214218 EditIconFile = select.Data.IconFile;
219新增: EditColor = select.Data.Color;
215220 }
216221 else
217222 {
修改UI/ViewModels/ChartPageVM.cs+3 −2看文件
@@ -136,7 +136,7 @@ namespace UI.ViewModels
136136 DataMaximum = 3600;
137137 Task.Run(() =>
138138 {
139删除:
139新增:
140140
141141 var list = data.GetCategoryHoursData(Date);
142142
@@ -163,6 +163,7 @@ namespace UI.ViewModels
163163 Name = category.Name,
164164 Icon = category.IconFile,
165165 Values = item.Values,
166新增: Color = category.Color
166167 };
167168 if (category.ID == 0)
168169 {
@@ -390,7 +391,7 @@ namespace UI.ViewModels
390391 bindModel.Data = item;
391392 bindModel.Name = string.IsNullOrEmpty(item.AppModel?.Description) ? item.AppModel.Name : item.AppModel.Description;
392393 bindModel.Value = item.Time;
393删除: bindModel.Tag =Time.ToString(item.Time);
394新增: bindModel.Tag = Time.ToString(item.Time);
394395 bindModel.PopupText = item.AppModel?.File;
395396 bindModel.Icon = item.AppModel?.IconFile;
396397 resData.Add(bindModel);
修改UI/Views/CategoryPage.xaml+31 −13看文件
@@ -5,7 +5,7 @@
55 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
66 xmlns:local="clr-namespace:UI.Views" xmlns:base="clr-namespace:UI.Controls.Base" xmlns:Button="clr-namespace:UI.Controls.Button" xmlns:input="clr-namespace:UI.Controls.Input" xmlns:select="clr-namespace:UI.Controls.Select"
77 mc:Ignorable="d"
8删除: xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
8新增: xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:converter="clr-namespace:UI.Controls.Converters"
99 d:DesignHeight="450" d:DesignWidth="800"
1010 Title="CategoryPage">
1111
@@ -28,14 +28,24 @@
2828 <Button:IconButton Foreground="#ccc" Icon="ChromeClose" HorizontalAlignment="Right" FontSize="12" Margin="0,0,10,0" Command="{Binding EditCloseCommand}"/>
2929 </Grid>
3030 <!--<TextBlock Text="编辑" VerticalAlignment="Center" Margin="10,0,0,0"/>-->
31新增: <ScrollViewer Grid.Row="1">
3132 <StackPanel Grid.Row="1" Margin="10">
3233 <TextBlock Text="分类名称"/>
33删除: <input:InputBox Error="{Binding EditErrorText}" IsShowError="{Binding IsEditError,Mode=TwoWay}" Text="{Binding EditName,Mode=TwoWay}" MaxLength="10" Margin="0,10,0,0"/>
3434
35删除: <TextBlock Text="分类图标" Margin="0,10,0,0"/>
35新增: <Grid>
36新增: <Grid.ColumnDefinitions>
37新增: <ColumnDefinition Width="auto"/>
38新增: <ColumnDefinition Width="*"/>
39新增: </Grid.ColumnDefinitions>
40新增: <base:ColorSelect Color="{Binding EditColor,Mode=TwoWay}" ToolTip="选择分类颜色" HorizontalAlignment="Left" Margin="0,10,0,0" />
41新增:
42新增: <input:InputBox Grid.Column="1" Error="{Binding EditErrorText}" IsShowError="{Binding IsEditError,Mode=TwoWay}" Text="{Binding EditName,Mode=TwoWay}" MaxLength="10" Margin="5,10,0,0"/>
43新增: </Grid>
44新增:
45新增: <TextBlock Text="图标" Margin="0,10,0,0"/>
3646 <base:IconSelect URL="{Binding EditIconFile,Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,10,0,0" />
3747 </StackPanel>
38删除:
48新增: </ScrollViewer>
3949 <Button:Button Grid.Row="2" HorizontalAlignment="Right" Text="?创建:更新" Value="{Binding IsCreate}" Width="120" Margin="0,0,10,0" VerticalAlignment="Center" Command="{Binding EditDoneCommand}">
4050
4151 </Button:Button>
@@ -77,6 +87,8 @@
7787 </ContextMenu>
7888 </ListView.ContextMenu>
7989 <ListBox.Resources>
90新增: <converter:HextoColorConverter x:Key="HextoColorConverter"/>
91新增:
8092 <Style TargetType="{x:Type ListView}">
8193 <Setter Property="OverridesDefaultStyle" Value="True"/>
8294
@@ -101,7 +113,7 @@
101113 <DropShadowEffect Color="#d8d2d2" BlurRadius="10" Direction="300" ShadowDepth="4" Opacity="0.1" RenderingBias="Performance" ></DropShadowEffect>
102114 </Border.Effect>
103115 </Border>
104删除: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="White" Margin="5" CornerRadius="10">
116新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="White" Margin="5" CornerRadius="20">
105117 <ContentPresenter/>
106118 </Border>
107119 </Grid>
@@ -126,27 +138,33 @@
126138 </ListBox.ItemsPanel>
127139 <ListView.ItemTemplate>
128140 <DataTemplate>
141新增:
129142
130143 <WrapPanel Orientation="Vertical">
131144 <Border Width="150" Height="150">
132145
133146 <Grid>
134147 <Grid.RowDefinitions>
135删除: <RowDefinition Height="80"/>
148新增: <RowDefinition Height="40"/>
149新增:
150新增: <RowDefinition Height="40"/>
136151 <RowDefinition Height="30"/>
137152 <RowDefinition Height="*"/>
138153
139154 </Grid.RowDefinitions>
140删除: <Border>
141删除: <base:Img Radius="10" Width="50" Height="50" URL="{Binding Data.IconFile}"/>
142删除: </Border>
143删除: <TextBlock Foreground="#202020" HorizontalAlignment="Center" Grid.Row="1" Text="{Binding Data.Name}" FontSize="14"/>
155新增: <Rectangle HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" RadiusX="20" RadiusY="20" Width="20" Height="20" Fill="{Binding Data.Color,Converter={StaticResource HextoColorConverter}}"/>
156新增: <Grid Grid.Row="1">
157新增:
158新增: <base:Img Radius="8" Width="40" Height="40" URL="{Binding Data.IconFile}"/>
159新增: </Grid>
160新增: <TextBlock Foreground="#202020" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Text="{Binding Data.Name}" FontSize="14"/>
144161
145删除: <Border Grid.Row="2" >
146删除: <Border Margin="10,0,0,0" CornerRadius="5" Background="#f9f9f9" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="15,5">
162新增: <Border Grid.Row="3" >
163新增: <Border Margin="10,0,10,0" CornerRadius="10" Background="#f9f9f9" HorizontalAlignment="Right" VerticalAlignment="Center" Padding="10,5">
147164 <TextBlock Foreground="#FF737373">
165新增: <Run Text="×"/>
166新增:
148167 <Run Text="{Binding Count}"/>
149删除: <Run Text="个应用"/>
150168 </TextBlock>
151169
152170 </Border>