提交记录修改Core/Models/CategoryModel.cs+24 −1看文件
修改Core/Properties/AssemblyInfo.cs+2 −2看文件
修改Core/Servicers/Instances/Main.cs+52 −1看文件
修改UI/App.xaml+0 −8看文件
修改UI/App.xaml.cs+0 −23看文件
修改UI/Controls/List/BaseList.cs+9 −0看文件
修改UI/Controls/Toggle/Toggle.cs+9 −3看文件
新增UI/Controls/Toggle/ToggleTextPosition.cs+23 −0看文件
修改UI/Models/CategoryPageModel.cs+15 −1看文件
修改UI/Themes/Toggle/Toggle.xaml+31 −11看文件
修改UI/UI.csproj+1 −0看文件
修改UI/ViewModels/CategoryPageVM.cs+167 −84看文件
修改UI/Views/CategoryPage.xaml+133 −103看文件
| @@ -1,6 +1,8 @@ | ||
| 1 | 删除:using System; | |
| 1 | 新增:using Newtonsoft.Json; | |
| 2 | 新增:using System; | |
| 2 | 3 | using System.Collections.Generic; |
| 3 | 4 | using System.ComponentModel.DataAnnotations; |
| 5 | 新增:using System.ComponentModel.DataAnnotations.Schema; | |
| 4 | 6 | using System.Linq; |
| 5 | 7 | using System.Text; |
| 6 | 8 | using System.Threading.Tasks; |
| @@ -28,5 +30,26 @@ namespace Core.Models | ||
| 28 | 30 | /// 颜色 |
| 29 | 31 | /// </summary> |
| 30 | 32 | public string Color { get; set; } |
| 33 | 新增: /// <summary> | |
| 34 | 新增: /// 是否启用目录匹配 | |
| 35 | 新增: /// </summary> | |
| 36 | 新增: public bool IsDirectoryMath { get; set; } = false; | |
| 37 | 新增: /// <summary> | |
| 38 | 新增: /// 匹配目录(Json List string) | |
| 39 | 新增: /// </summary> | |
| 40 | 新增: public string Directories { get; set; } | |
| 41 | 新增: | |
| 42 | 新增: /// <summary> | |
| 43 | 新增: /// 匹配目录集合(已解析) | |
| 44 | 新增: /// </summary> | |
| 45 | 新增: [NotMapped] | |
| 46 | 新增: public List<string> DirectoryList | |
| 47 | 新增: { | |
| 48 | 新增: get | |
| 49 | 新增: { | |
| 50 | 新增: if (string.IsNullOrEmpty(Directories)) return new List<string>(); | |
| 51 | 新增: return JsonConvert.DeserializeObject<List<string>>(Directories); | |
| 52 | 新增: } | |
| 53 | 新增: } | |
| 31 | 54 | } |
| 32 | 55 | } |
| @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; | ||
| 32 | 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 |
| 33 | 33 | //通过使用 "*",如下所示: |
| 34 | 34 | // [assembly: AssemblyVersion("1.0.*")] |
| 35 | 删除:[assembly: AssemblyVersion("1.1.0.4")] | |
| 36 | 删除:[assembly: AssemblyFileVersion("1.1.0.4")] | |
| 35 | 新增:[assembly: AssemblyVersion("1.1.0.5")] | |
| 36 | 新增:[assembly: AssemblyFileVersion("1.1.0.5")] | |
| @@ -471,6 +471,8 @@ namespace Core.Servicers.Instances | ||
| 471 | 471 | // 关联进程更新 |
| 472 | 472 | HandleLinks(app.Process, duration, startTime); |
| 473 | 473 | OnUpdateTime?.Invoke(this, null); |
| 474 | 新增: // 自动分类 | |
| 475 | 新增: DispatchCateogry(app.Process, app.ExecutablePath); | |
| 474 | 476 | } |
| 475 | 477 | } |
| 476 | 478 | catch (Exception ex) |
| @@ -506,7 +508,56 @@ namespace Core.Servicers.Instances | ||
| 506 | 508 | string path = await FaviconDownloader.DownloadAsync(args.Icon, saveName); |
| 507 | 509 | _webData.UpdateUrlFavicon(site, path); |
| 508 | 510 | }); |
| 509 | 删除: }catch(Exception ex) | |
| 511 | 新增: } | |
| 512 | 新增: catch (Exception ex) | |
| 513 | 新增: { | |
| 514 | 新增: Logger.Error(ex.ToString()); | |
| 515 | 新增: } | |
| 516 | 新增: } | |
| 517 | 新增: #endregion | |
| 518 | 新增: | |
| 519 | 新增: #region 自动分类 | |
| 520 | 新增: /// <summary> | |
| 521 | 新增: /// 自动分类 | |
| 522 | 新增: /// </summary> | |
| 523 | 新增: /// <param name="processName_">进程名称</param> | |
| 524 | 新增: private void DispatchCateogry(string processName_, string executablePath_) | |
| 525 | 新增: { | |
| 526 | 新增: try | |
| 527 | 新增: { | |
| 528 | 新增: AppModel app = appData.GetApp(processName_); | |
| 529 | 新增: if (app != null) | |
| 530 | 新增: { | |
| 531 | 新增: var categoryList = categories.GetCategories().Where(c => c.IsDirectoryMath && c.DirectoryList.Count > 0).ToList(); | |
| 532 | 新增: CategoryModel mathCategory = null; | |
| 533 | 新增: foreach (var category in categoryList) | |
| 534 | 新增: { | |
| 535 | 新增: if (mathCategory != null) | |
| 536 | 新增: { | |
| 537 | 新增: break; | |
| 538 | 新增: } | |
| 539 | 新增: foreach (var item in category.DirectoryList) | |
| 540 | 新增: { | |
| 541 | 新增: string path = item.Replace("\\", "\\\\"); | |
| 542 | 新增: if (Regex.IsMatch(executablePath_, @"^" + path)) | |
| 543 | 新增: { | |
| 544 | 新增: mathCategory = category; | |
| 545 | 新增: Debug.WriteLine("匹配成功:" + category.Name); | |
| 546 | 新增: break; | |
| 547 | 新增: } | |
| 548 | 新增: } | |
| 549 | 新增: | |
| 550 | 新增: } | |
| 551 | 新增: if (mathCategory != null) | |
| 552 | 新增: { | |
| 553 | 新增: // 匹配成功 | |
| 554 | 新增: app.Category = mathCategory; | |
| 555 | 新增: app.CategoryID = mathCategory.ID; | |
| 556 | 新增: appData.UpdateApp(app); | |
| 557 | 新增: } | |
| 558 | 新增: } | |
| 559 | 新增: } | |
| 560 | 新增: catch (Exception ex) | |
| 510 | 561 | { |
| 511 | 562 | Logger.Error(ex.ToString()); |
| 512 | 563 | } |
| @@ -16,14 +16,6 @@ | ||
| 16 | 16 | <Setter Property="FontFamily" Value="Segoe UI, Microsoft YaHei UI" /> |
| 17 | 17 | </Style> |
| 18 | 18 | |
| 19 | 删除: <Style TargetType="{x:Type ScrollViewer}"> | |
| 20 | 删除: <EventSetter Event="PreviewMouseWheel" Handler="ScrollViewer_PreviewMouseWheel"/> | |
| 21 | 删除: <Setter Property="PanningMode" Value="VerticalFirst"/> | |
| 22 | 删除: | |
| 23 | 删除: <!--阻止触摸拉到尽头时的弹簧效果--> | |
| 24 | 删除: <EventSetter Event="ManipulationBoundaryFeedback" Handler="ScrollViewer_ManipulationBoundaryFeedback"/> | |
| 25 | 删除: </Style> | |
| 26 | 删除: | |
| 27 | 19 | <ResourceDictionary.MergedDictionaries> |
| 28 | 20 | <ResourceDictionary Source="/Tai;component/Resources/Themes/Light.xaml"/> |
| 29 | 21 | <ResourceDictionary Source="/Tai;component/Resources/Themes/Common.xaml"/> |
| @@ -176,28 +176,5 @@ namespace UI | ||
| 176 | 176 | // 创建保活窗口 |
| 177 | 177 | keepaliveWindow = new HideWindow(); |
| 178 | 178 | } |
| 179 | 删除: | |
| 180 | 删除: private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) | |
| 181 | 删除: { | |
| 182 | 删除: try | |
| 183 | 删除: { | |
| 184 | 删除: if (System.Windows.Forms.SystemInformation.MouseWheelScrollLines == -1) | |
| 185 | 删除: { | |
| 186 | 删除: e.Handled = false; | |
| 187 | 删除: } | |
| 188 | 删除: else | |
| 189 | 删除: { | |
| 190 | 删除: System.Windows.Controls.ScrollViewer SenderScrollViewer = (System.Windows.Controls.ScrollViewer)sender; | |
| 191 | 删除: SenderScrollViewer.ScrollToVerticalOffset(SenderScrollViewer.VerticalOffset - e.Delta * 10 * System.Windows.Forms.SystemInformation.MouseWheelScrollLines / (double)120); | |
| 192 | 删除: e.Handled = true; | |
| 193 | 删除: } | |
| 194 | 删除: } | |
| 195 | 删除: catch { } | |
| 196 | 删除: } | |
| 197 | 删除: | |
| 198 | 删除: private void ScrollViewer_ManipulationBoundaryFeedback(object sender, System.Windows.Input.ManipulationBoundaryFeedbackEventArgs e) | |
| 199 | 删除: { | |
| 200 | 删除: e.Handled = true; | |
| 201 | 删除: } | |
| 202 | 179 | } |
| 203 | 180 | } |
| @@ -22,6 +22,7 @@ namespace UI.Controls.List | ||
| 22 | 22 | if (e.NewValue != e.OldValue) |
| 23 | 23 | { |
| 24 | 24 | control.Render(); |
| 25 | 新增: control.AddCollectionChangedHandler(); | |
| 25 | 26 | } |
| 26 | 27 | } |
| 27 | 28 | |
| @@ -52,6 +53,14 @@ namespace UI.Controls.List | ||
| 52 | 53 | DefaultStyleKey = typeof(BaseList); |
| 53 | 54 | Items = new ObservableCollection<string>(); |
| 54 | 55 | ItemsMap = new List<BaseListItem>(); |
| 56 | 新增: AddCollectionChangedHandler(); | |
| 57 | 新增: } | |
| 58 | 新增: | |
| 59 | 新增: private void AddCollectionChangedHandler() | |
| 60 | 新增: { | |
| 61 | 新增: if (Items == null) return; | |
| 62 | 新增: | |
| 63 | 新增: Items.CollectionChanged -= Items_CollectionChanged; | |
| 55 | 64 | Items.CollectionChanged += Items_CollectionChanged; |
| 56 | 65 | } |
| 57 | 66 | |
| @@ -23,10 +23,16 @@ namespace UI.Controls.Toggle | ||
| 23 | 23 | private static void OnIsCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) |
| 24 | 24 | { |
| 25 | 25 | var control = d as Toggle; |
| 26 | 删除: | |
| 26 | 新增: | |
| 27 | 27 | VisualStateManager.GoToState(control, control.IsChecked ? "On" : "Off", true); |
| 28 | 28 | } |
| 29 | 删除: | |
| 29 | 新增: public ToggleTextPosition TextPosition | |
| 30 | 新增: { | |
| 31 | 新增: get { return (ToggleTextPosition)GetValue(TextPositionProperty); } | |
| 32 | 新增: set { SetValue(TextPositionProperty, value); } | |
| 33 | 新增: } | |
| 34 | 新增: public static readonly DependencyProperty TextPositionProperty = | |
| 35 | 新增: DependencyProperty.Register("TextPosition", typeof(ToggleTextPosition), typeof(Toggle), new PropertyMetadata(ToggleTextPosition.Right)); | |
| 30 | 36 | public string OnText |
| 31 | 37 | { |
| 32 | 38 | get { return (string)GetValue(OnTextProperty); } |
| @@ -59,7 +65,7 @@ namespace UI.Controls.Toggle | ||
| 59 | 65 | { |
| 60 | 66 | base.OnApplyTemplate(); |
| 61 | 67 | } |
| 62 | 删除: | |
| 68 | 新增: | |
| 63 | 69 | protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) |
| 64 | 70 | { |
| 65 | 71 | base.OnMouseLeftButtonUp(e); |
| @@ -0,0 +1,23 @@ | ||
| 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.Toggle | |
| 8 | 新增:{ | |
| 9 | 新增: /// <summary> | |
| 10 | 新增: /// 开关文本位置 | |
| 11 | 新增: /// </summary> | |
| 12 | 新增: public enum ToggleTextPosition | |
| 13 | 新增: { | |
| 14 | 新增: /// <summary> | |
| 15 | 新增: /// 左 | |
| 16 | 新增: /// </summary> | |
| 17 | 新增: Left, | |
| 18 | 新增: /// <summary> | |
| 19 | 新增: /// 右 | |
| 20 | 新增: /// </summary> | |
| 21 | 新增: Right | |
| 22 | 新增: } | |
| 23 | 新增:} | |
| @@ -47,7 +47,21 @@ namespace UI.Models | ||
| 47 | 47 | get { return EditIconFile_; } |
| 48 | 48 | set { EditIconFile_ = value; OnPropertyChanged(); } |
| 49 | 49 | } |
| 50 | 删除: | |
| 50 | 新增: private bool EditIsDirectoryMath_; | |
| 51 | 新增: /// <summary> | |
| 52 | 新增: /// 是否启用目录匹配 | |
| 53 | 新增: /// </summary> | |
| 54 | 新增: public bool EditIsDirectoryMath { get { return EditIsDirectoryMath_; } set { EditIsDirectoryMath_ = value; OnPropertyChanged(); } } | |
| 55 | 新增: private ObservableCollection<string> EditDirectories_ = new ObservableCollection<string>(); | |
| 56 | 新增: /// <summary> | |
| 57 | 新增: /// 匹配目录 | |
| 58 | 新增: /// </summary> | |
| 59 | 新增: public ObservableCollection<string> EditDirectories { get { return EditDirectories_; } set { EditDirectories_ = value; OnPropertyChanged(); } } | |
| 60 | 新增: private string EditSelectedDirectory_; | |
| 61 | 新增: /// <summary> | |
| 62 | 新增: /// 当前列表选择目录 | |
| 63 | 新增: /// </summary> | |
| 64 | 新增: public string EditSelectedDirectory { get { return EditSelectedDirectory_; } set { EditSelectedDirectory_ = value; OnPropertyChanged(); } } | |
| 51 | 65 | private string EditErrorText_; |
| 52 | 66 | public string EditErrorText |
| 53 | 67 | { |
| @@ -14,18 +14,22 @@ | ||
| 14 | 14 | <Border x:Name="Border" Background="{TemplateBinding Background}" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" CornerRadius="4" Margin="{TemplateBinding Margin}"> |
| 15 | 15 | <Grid> |
| 16 | 16 | <Grid.ColumnDefinitions> |
| 17 | 新增: <ColumnDefinition Width="auto"/> | |
| 17 | 18 | <ColumnDefinition Width="50"/> |
| 18 | 删除: <ColumnDefinition Width="*"/> | |
| 19 | 新增: <ColumnDefinition Width="auto"/> | |
| 19 | 20 | </Grid.ColumnDefinitions> |
| 20 | 删除: <Border x:Name="Button" Background="#f5f5f5" CornerRadius="10" Padding="5"> | |
| 21 | 新增: <Border x:Name="Button" Grid.Column="1" Background="#f5f5f5" CornerRadius="10" Padding="5"> | |
| 21 | 22 | <Border x:Name="Mark" Width="12" Height="12" CornerRadius="15" Background="#5d5d5d" VerticalAlignment="Center" HorizontalAlignment="Left"> |
| 22 | 23 | <Border.RenderTransform> |
| 23 | 24 | <TranslateTransform X="0"/> |
| 24 | 25 | </Border.RenderTransform> |
| 25 | 26 | </Border> |
| 26 | 27 | </Border> |
| 27 | 删除: <TextBlock x:Name="OnText" Grid.Column="1" VerticalAlignment="Center" Margin="10,0,0,0" Text="{TemplateBinding OnText}"/> | |
| 28 | 删除: <TextBlock x:Name="OffText" Grid.Column="1" VerticalAlignment="Center" Margin="10,0,0,0" Text="{TemplateBinding OffText}"/> | |
| 28 | 新增: <Grid x:Name="TextContainer" Grid.Column="2" Margin="10,0,0,0"> | |
| 29 | 新增: <TextBlock x:Name="OnText" VerticalAlignment="Center" Text="{TemplateBinding OnText}"/> | |
| 30 | 新增: <TextBlock x:Name="OffText" VerticalAlignment="Center" Text="{TemplateBinding OffText}"/> | |
| 31 | 新增: </Grid> | |
| 32 | 新增: | |
| 29 | 33 | |
| 30 | 34 | </Grid> |
| 31 | 35 | |
| @@ -79,13 +83,21 @@ | ||
| 79 | 83 | <DataTrigger.EnterActions> |
| 80 | 84 | <BeginStoryboard> |
| 81 | 85 | <Storyboard> |
| 82 | 删除: <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.RenderTransform). | |
| 83 | 删除: (TranslateTransform.X)" | |
| 84 | 删除: Storyboard.TargetName="Mark"> | |
| 85 | 删除: <EasingDoubleKeyFrame KeyTime="00:00:0" | |
| 86 | 删除: Value="28" /> | |
| 87 | 删除: </DoubleAnimationUsingKeyFrames> | |
| 88 | 删除: | |
| 86 | 新增: <DoubleAnimation Storyboard.TargetProperty="(Border.RenderTransform). | |
| 87 | 新增:(TranslateTransform.X)" | |
| 88 | 新增: Storyboard.TargetName="Mark" To="28" Duration="0"></DoubleAnimation> | |
| 89 | 新增: </Storyboard> | |
| 90 | 新增: </BeginStoryboard> | |
| 91 | 新增: </DataTrigger.EnterActions> | |
| 92 | 新增: </DataTrigger> | |
| 93 | 新增: <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsChecked}" Value="False"> | |
| 94 | 新增: <DataTrigger.EnterActions> | |
| 95 | 新增: <BeginStoryboard> | |
| 96 | 新增: <Storyboard> | |
| 97 | 新增: <DoubleAnimation Storyboard.TargetProperty="(Border.RenderTransform). | |
| 98 | 新增:(TranslateTransform.X)" | |
| 99 | 新增: Storyboard.TargetName="Mark" To="0" Duration="0"></DoubleAnimation> | |
| 100 | 新增: | |
| 89 | 101 | </Storyboard> |
| 90 | 102 | </BeginStoryboard> |
| 91 | 103 | </DataTrigger.EnterActions> |
| @@ -98,6 +110,14 @@ | ||
| 98 | 110 | <Setter TargetName="OffText" Property="Visibility" Value="Visible"/> |
| 99 | 111 | <Setter TargetName="OnText" Property="Visibility" Value="Collapsed"/> |
| 100 | 112 | </Trigger> |
| 113 | 新增: <Trigger Property="IsChecked" Value="False"> | |
| 114 | 新增: <Setter TargetName="OffText" Property="Visibility" Value="Visible"/> | |
| 115 | 新增: <Setter TargetName="OnText" Property="Visibility" Value="Collapsed"/> | |
| 116 | 新增: </Trigger> | |
| 117 | 新增: <Trigger Property="TextPosition" Value="Left"> | |
| 118 | 新增: <Setter TargetName="TextContainer" Property="Grid.Column" Value="0"/> | |
| 119 | 新增: <Setter TargetName="TextContainer" Property="Margin" Value="0,0,10,0"/> | |
| 120 | 新增: </Trigger> | |
| 101 | 121 | </ControlTemplate.Triggers> |
| 102 | 122 | |
| 103 | 123 | </ControlTemplate> |
| @@ -184,6 +184,7 @@ | ||
| 184 | 184 | <Compile Include="Controls\SettingPanel\SettingPanel.cs" /> |
| 185 | 185 | <Compile Include="Controls\Tabbar\Tabbar.cs" /> |
| 186 | 186 | <Compile Include="Controls\Toggle\Toggle.cs" /> |
| 187 | 新增: <Compile Include="Controls\Toggle\ToggleTextPosition.cs" /> | |
| 187 | 188 | <Compile Include="Controls\TPage.cs" /> |
| 188 | 189 | <Compile Include="Controls\Window\ToastType.cs" /> |
| 189 | 190 | <Compile Include="Extensions\ListExtensions.cs" /> |
| @@ -1,10 +1,15 @@ | ||
| 1 | 删除:using Core.Servicers.Interfaces; | |
| 1 | 新增:using Core.Librarys; | |
| 2 | 新增:using Core.Servicers.Instances; | |
| 3 | 新增:using Core.Servicers.Interfaces; | |
| 4 | 新增:using Newtonsoft.Json; | |
| 2 | 5 | using System; |
| 3 | 6 | using System.Collections.Generic; |
| 7 | 新增:using System.Diagnostics; | |
| 4 | 8 | using System.IO; |
| 5 | 9 | using System.Linq; |
| 6 | 10 | using System.Text; |
| 7 | 11 | using System.Threading.Tasks; |
| 12 | 新增:using System.Windows.Forms; | |
| 8 | 13 | using UI.Controls; |
| 9 | 14 | using UI.Controls.Select; |
| 10 | 15 | using UI.Models; |
| @@ -40,6 +45,14 @@ namespace UI.ViewModels | ||
| 40 | 45 | /// 刷新 |
| 41 | 46 | /// </summary> |
| 42 | 47 | public Command RefreshCommand { get; set; } |
| 48 | 新增: /// <summary> | |
| 49 | 新增: /// 添加目录 | |
| 50 | 新增: /// </summary> | |
| 51 | 新增: public Command AddDirectoryCommand { get; set; } | |
| 52 | 新增: /// <summary> | |
| 53 | 新增: /// 目录菜单命令 | |
| 54 | 新增: /// </summary> | |
| 55 | 新增: public Command DirectoriesCommand { get; set; } | |
| 43 | 56 | |
| 44 | 57 | |
| 45 | 58 | public CategoryPageVM(ICategorys categorys, MainViewModel mainVM, IAppData appData, IWebData webData_) |
| @@ -55,6 +68,9 @@ namespace UI.ViewModels | ||
| 55 | 68 | EditCloseCommand = new Command(new Action<object>(OnEditClose)); |
| 56 | 69 | DelCommand = new Command(new Action<object>(OnDel)); |
| 57 | 70 | RefreshCommand = new Command(new Action<object>(OnRefresh)); |
| 71 | 新增: AddDirectoryCommand = new Command(OnAddDirectory); | |
| 72 | 新增: DirectoriesCommand = new Command(OnDirectoriesCommand); | |
| 73 | 新增: | |
| 58 | 74 | LoadData(); |
| 59 | 75 | |
| 60 | 76 | PropertyChanged += CategoryPageVM_PropertyChanged; |
| @@ -65,7 +81,7 @@ namespace UI.ViewModels | ||
| 65 | 81 | LoadData(); |
| 66 | 82 | } |
| 67 | 83 | |
| 68 | 删除: | |
| 84 | 新增: | |
| 69 | 85 | private void OnDel(object obj) |
| 70 | 86 | { |
| 71 | 87 | if (ShowType.Id == 0) |
| @@ -94,6 +110,44 @@ namespace UI.ViewModels | ||
| 94 | 110 | } |
| 95 | 111 | } |
| 96 | 112 | |
| 113 | 新增: private void OnAddDirectory(object obj) | |
| 114 | 新增: { | |
| 115 | 新增: try | |
| 116 | 新增: { | |
| 117 | 新增: FolderBrowserDialog dialog = new FolderBrowserDialog(); | |
| 118 | 新增: dialog.Description = "选择匹配目录"; | |
| 119 | 新增: if (dialog.ShowDialog() == DialogResult.OK) | |
| 120 | 新增: { | |
| 121 | 新增: string path = dialog.SelectedPath + "\\"; | |
| 122 | 新增: if (EditDirectories.Contains(path)) | |
| 123 | 新增: { | |
| 124 | 新增: mainVM.Toast("目录已存在", Controls.Window.ToastType.Error); | |
| 125 | 新增: return; | |
| 126 | 新增: } | |
| 127 | 新增: EditDirectories.Add(path); | |
| 128 | 新增: mainVM.Toast("已添加", Controls.Window.ToastType.Success); | |
| 129 | 新增: } | |
| 130 | 新增: } | |
| 131 | 新增: catch (Exception ec) | |
| 132 | 新增: { | |
| 133 | 新增: Logger.Error(ec.ToString()); | |
| 134 | 新增: mainVM.Toast("添加失败,请重试", Controls.Window.ToastType.Error); | |
| 135 | 新增: } | |
| 136 | 新增: } | |
| 137 | 新增: | |
| 138 | 新增: private void OnDirectoriesCommand(object obj) | |
| 139 | 新增: { | |
| 140 | 新增: string action = obj.ToString(); | |
| 141 | 新增: switch (action) | |
| 142 | 新增: { | |
| 143 | 新增: case "remove": | |
| 144 | 新增: if (string.IsNullOrEmpty(EditSelectedDirectory)) return; | |
| 145 | 新增: | |
| 146 | 新增: EditDirectories.Remove(EditSelectedDirectory); | |
| 147 | 新增: break; | |
| 148 | 新增: } | |
| 149 | 新增: } | |
| 150 | 新增: | |
| 97 | 151 | #region 编辑校验 |
| 98 | 152 | /// <summary> |
| 99 | 153 | /// 编辑校验 |
| @@ -129,106 +183,121 @@ namespace UI.ViewModels | ||
| 129 | 183 | #region 编辑应用分类 |
| 130 | 184 | private void EditAppCategoryAction() |
| 131 | 185 | { |
| 132 | 删除: if (!IsEditVerify()) return; | |
| 133 | 删除: | |
| 134 | 删除: if (IsCreate) | |
| 186 | 新增: try | |
| 135 | 187 | { |
| 136 | 删除: // 创建分类 | |
| 188 | 新增: if (!IsEditVerify()) return; | |
| 137 | 189 | |
| 138 | 删除: // 判断重复分类名称 | |
| 139 | 删除: if (Data.Where(m => m.Data.Name == EditName).Any()) | |
| 140 | 删除: { | |
| 141 | 删除: mainVM.Toast("分类名称已存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 142 | 删除: return; | |
| 143 | 删除: } | |
| 144 | 删除: if (Data.Where(m => m.Data.Color == EditColor).Any()) | |
| 190 | 新增: string directoriesStr = JsonConvert.SerializeObject(EditDirectories.ToList()); | |
| 191 | 新增: | |
| 192 | 新增: if (IsCreate) | |
| 145 | 193 | { |
| 146 | 删除: mainVM.Toast("颜色已存在,请重新选择", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 147 | 删除: return; | |
| 148 | 删除: } | |
| 149 | 删除: mainVM.Toast("创建完成", Controls.Window.ToastType.Success); | |
| 194 | 新增: // 创建分类 | |
| 150 | 195 | |
| 151 | 删除: EditVisibility = System.Windows.Visibility.Collapsed; | |
| 196 | 新增: // 判断重复分类名称 | |
| 197 | 新增: if (Data.Where(m => m.Data.Name == EditName).Any()) | |
| 198 | 新增: { | |
| 199 | 新增: mainVM.Toast("分类名称已存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 200 | 新增: return; | |
| 201 | 新增: } | |
| 202 | 新增: //if (Data.Where(m => m.Data.Color == EditColor).Any()) | |
| 203 | 新增: //{ | |
| 204 | 新增: // mainVM.Toast("颜色已存在,请重新选择", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 205 | 新增: // return; | |
| 206 | 新增: //} | |
| 207 | 新增: mainVM.Toast("创建完成", Controls.Window.ToastType.Success); | |
| 152 | 208 | |
| 153 | 删除: var res = categorys.Create(new Core.Models.CategoryModel() | |
| 154 | 删除: { | |
| 155 | 删除: Name = EditName, | |
| 156 | 删除: IconFile = EditIconFile, | |
| 157 | 删除: Color = EditColor, | |
| 158 | 删除: }); | |
| 209 | 新增: EditVisibility = System.Windows.Visibility.Collapsed; | |
| 159 | 210 | |
| 160 | 删除: var item = new CategoryModel() | |
| 161 | 删除: { | |
| 162 | 删除: Data = res, | |
| 163 | 删除: Count = 0 | |
| 164 | 删除: }; | |
| 165 | 删除: if (Data.Count == 0) | |
| 166 | 删除: { | |
| 167 | 删除: //Data=new System.Collections.ObjectModel.ObservableCollection<CategoryModel>() | |
| 168 | 删除: var list = new System.Collections.ObjectModel.ObservableCollection<CategoryModel>(); | |
| 169 | 删除: list.Add(item); | |
| 170 | 删除: Data = list; | |
| 171 | 删除: } | |
| 172 | 删除: else | |
| 173 | 删除: { | |
| 174 | 删除: Data.Add(item); | |
| 175 | 删除: } | |
| 211 | 新增: var res = categorys.Create(new Core.Models.CategoryModel() | |
| 212 | 新增: { | |
| 213 | 新增: Name = EditName, | |
| 214 | 新增: IconFile = EditIconFile, | |
| 215 | 新增: Color = EditColor, | |
| 216 | 新增: IsDirectoryMath = EditIsDirectoryMath, | |
| 217 | 新增: Directories = directoriesStr, | |
| 218 | 新增: }); | |
| 176 | 219 | |
| 177 | 删除: } | |
| 178 | 删除: else | |
| 179 | 删除: { | |
| 180 | 删除: // 编辑分类 | |
| 220 | 新增: var item = new CategoryModel() | |
| 221 | 新增: { | |
| 222 | 新增: Data = res, | |
| 223 | 新增: Count = 0 | |
| 224 | 新增: }; | |
| 225 | 新增: if (Data.Count == 0) | |
| 226 | 新增: { | |
| 227 | 新增: //Data=new System.Collections.ObjectModel.ObservableCollection<CategoryModel>() | |
| 228 | 新增: var list = new System.Collections.ObjectModel.ObservableCollection<CategoryModel>(); | |
| 229 | 新增: list.Add(item); | |
| 230 | 新增: Data = list; | |
| 231 | 新增: } | |
| 232 | 新增: else | |
| 233 | 新增: { | |
| 234 | 新增: Data.Add(item); | |
| 235 | 新增: } | |
| 181 | 236 | |
| 182 | 删除: // 判断重复分类名称 | |
| 183 | 删除: if (Data.Where(m => m.Data.Name == EditName && m.Data.ID != SelectedAppCategoryItem.Data.ID).Any()) | |
| 184 | 删除: { | |
| 185 | 删除: mainVM.Toast("分类名称已存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 186 | 删除: return; | |
| 187 | 删除: } | |
| 188 | 删除: if (Data.Where(m => m.Data.Color == EditColor && m.Data.ID != SelectedAppCategoryItem.Data.ID).Any()) | |
| 189 | 删除: { | |
| 190 | 删除: mainVM.Toast("颜色已存在,请重新选择", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 191 | 删除: return; | |
| 192 | 237 | } |
| 193 | 删除: if (EditName == SelectedAppCategoryItem.Data.Name && EditIconFile == SelectedAppCategoryItem.Data.IconFile && EditColor == SelectedAppCategoryItem.Data.Color) | |
| 238 | 新增: else | |
| 194 | 239 | { |
| 195 | 删除: mainVM.Toast("没有修改"); | |
| 196 | 删除: EditVisibility = System.Windows.Visibility.Collapsed; | |
| 197 | 删除: return; | |
| 198 | 删除: } | |
| 199 | 删除: mainVM.Toast("已更新", Controls.Window.ToastType.Success); | |
| 240 | 新增: // 编辑分类 | |
| 200 | 241 | |
| 201 | 删除: var category = categorys.GetCategory(SelectedAppCategoryItem.Data.ID); | |
| 202 | 删除: if (category != null) | |
| 203 | 删除: { | |
| 204 | 删除: category.Name = EditName; | |
| 205 | 删除: category.IconFile = EditIconFile; | |
| 206 | 删除: category.Color = EditColor; | |
| 242 | 新增: // 判断重复分类名称 | |
| 243 | 新增: if (Data.Where(m => m.Data.Name == EditName && m.Data.ID != SelectedAppCategoryItem.Data.ID).Any()) | |
| 244 | 新增: { | |
| 245 | 新增: mainVM.Toast("分类名称已存在", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 246 | 新增: return; | |
| 247 | 新增: } | |
| 248 | 新增: //if (Data.Where(m => m.Data.Color == EditColor && m.Data.ID != SelectedAppCategoryItem.Data.ID).Any()) | |
| 249 | 新增: //{ | |
| 250 | 新增: // mainVM.Toast("颜色已存在,请重新选择", Controls.Window.ToastType.Error, Controls.Base.IconTypes.ImportantBadge12); | |
| 251 | 新增: // return; | |
| 252 | 新增: //} | |
| 253 | 新增: //if (EditName == SelectedAppCategoryItem.Data.Name && EditIconFile == SelectedAppCategoryItem.Data.IconFile && EditColor == SelectedAppCategoryItem.Data.Color) | |
| 254 | 新增: //{ | |
| 255 | 新增: // mainVM.Toast("没有修改"); | |
| 256 | 新增: // EditVisibility = System.Windows.Visibility.Collapsed; | |
| 257 | 新增: // return; | |
| 258 | 新增: //} | |
| 259 | 新增: mainVM.Toast("已更新", Controls.Window.ToastType.Success); | |
| 260 | 新增: var category = categorys.GetCategory(SelectedAppCategoryItem.Data.ID); | |
| 261 | 新增: if (category != null) | |
| 262 | 新增: { | |
| 263 | 新增: category.Name = EditName; | |
| 264 | 新增: category.IconFile = EditIconFile; | |
| 265 | 新增: category.Color = EditColor; | |
| 266 | 新增: category.IsDirectoryMath = EditIsDirectoryMath; | |
| 267 | 新增: category.Directories = directoriesStr; | |
| 207 | 268 | |
| 208 | 删除: categorys.Update(category); | |
| 209 | 删除: } | |
| 269 | 新增: categorys.Update(category); | |
| 270 | 新增: } | |
| 210 | 271 | |
| 211 | 删除: var item = Data.Where(m => m.Data.ID == SelectedAppCategoryItem.Data.ID).FirstOrDefault(); | |
| 272 | 新增: var item = Data.Where(m => m.Data.ID == SelectedAppCategoryItem.Data.ID).FirstOrDefault(); | |
| 212 | 273 | |
| 213 | 删除: var changedItem = new CategoryModel() | |
| 214 | 删除: { | |
| 215 | 删除: Count = item.Count, | |
| 216 | 删除: Data = new Core.Models.CategoryModel() | |
| 274 | 新增: var changedItem = new CategoryModel() | |
| 217 | 275 | { |
| 218 | 删除: ID = item.Data.ID, | |
| 219 | 删除: Name = EditName, | |
| 220 | 删除: IconFile = EditIconFile, | |
| 221 | 删除: Color = EditColor | |
| 276 | 新增: Count = item.Count, | |
| 277 | 新增: Data = new Core.Models.CategoryModel() | |
| 278 | 新增: { | |
| 279 | 新增: ID = item.Data.ID, | |
| 280 | 新增: Name = EditName, | |
| 281 | 新增: IconFile = EditIconFile, | |
| 282 | 新增: Color = EditColor, | |
| 283 | 新增: IsDirectoryMath = EditIsDirectoryMath, | |
| 284 | 新增: Directories = directoriesStr | |
| 285 | 新增: } | |
| 286 | 新增: }; | |
| 287 | 新增: | |
| 288 | 新增: int editItemIndex = Data.IndexOf(item); | |
| 289 | 新增: if (editItemIndex != -1) | |
| 290 | 新增: { | |
| 291 | 新增: Data[editItemIndex] = changedItem; | |
| 222 | 292 | } |
| 223 | 删除: }; | |
| 224 | 293 | |
| 225 | 删除: int editItemIndex = Data.IndexOf(item); | |
| 226 | 删除: if (editItemIndex != -1) | |
| 227 | 删除: { | |
| 228 | 删除: Data[editItemIndex] = changedItem; | |
| 294 | 新增: EditVisibility = System.Windows.Visibility.Collapsed; | |
| 229 | 295 | } |
| 230 | 删除: | |
| 231 | 删除: EditVisibility = System.Windows.Visibility.Collapsed; | |
| 296 | 新增: } | |
| 297 | 新增: catch (Exception ec) | |
| 298 | 新增: { | |
| 299 | 新增: Logger.Error(ec.ToString()); | |
| 300 | 新增: mainVM.Toast("操作失败,请重试", Controls.Window.ToastType.Error); | |
| 232 | 301 | } |
| 233 | 302 | } |
| 234 | 303 | #endregion |
| @@ -404,12 +473,26 @@ namespace UI.ViewModels | ||
| 404 | 473 | EditName = appCategory == null ? webCategory.Data.Name : appCategory.Data.Name; |
| 405 | 474 | EditIconFile = appCategory == null ? webCategory.Data.IconFile : appCategory.Data.IconFile; |
| 406 | 475 | EditColor = string.IsNullOrEmpty(appCategory == null ? webCategory.Data.Color : appCategory.Data.Color) ? "#00FFAB" : appCategory == null ? webCategory.Data.Color : appCategory.Data.Color; |
| 476 | 新增: if (ShowType.Id == 0) | |
| 477 | 新增: { | |
| 478 | 新增: EditIsDirectoryMath = appCategory.Data.IsDirectoryMath; | |
| 479 | 新增: if (appCategory.Data.Directories != null) | |
| 480 | 新增: { | |
| 481 | 新增: EditDirectories = new System.Collections.ObjectModel.ObservableCollection<string>(appCategory.Data.DirectoryList); | |
| 482 | 新增: } | |
| 483 | 新增: else | |
| 484 | 新增: { | |
| 485 | 新增: EditDirectories = new System.Collections.ObjectModel.ObservableCollection<string>(); | |
| 486 | 新增: } | |
| 487 | 新增: } | |
| 407 | 488 | } |
| 408 | 489 | else |
| 409 | 490 | { |
| 410 | 491 | EditName = ""; |
| 411 | 492 | EditIconFile = "pack://application:,,,/Tai;component/Resources/Emoji/(1).png"; |
| 412 | 493 | EditColor = "#00FFAB"; |
| 494 | 新增: EditIsDirectoryMath = false; | |
| 495 | 新增: EditDirectories = new System.Collections.ObjectModel.ObservableCollection<string>(); | |
| 413 | 496 | } |
| 414 | 497 | } |
| 415 | 498 | |
| @@ -8,7 +8,8 @@ | ||
| 8 | 8 | xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" xmlns:converter="clr-namespace:UI.Controls.Converters" |
| 9 | 9 | xmlns:c="clr-namespace:UI.Controls" |
| 10 | 10 | d:DesignHeight="450" d:DesignWidth="800" |
| 11 | 删除: Title="CategoryPage" Foreground="{DynamicResource StandardTextBrush}" IsFillPage="True"> | |
| 11 | 新增: Title="CategoryPage" Foreground="{DynamicResource StandardTextBrush}" IsFillPage="True" | |
| 12 | 新增: xmlns:toggle="clr-namespace:UI.Controls.Toggle" xmlns:list="clr-namespace:UI.Controls.List"> | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | 15 | <Grid> |
| @@ -53,9 +54,29 @@ | ||
| 53 | 54 | |
| 54 | 55 | <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" Placeholder="请输入分类名称"/> |
| 55 | 56 | </Grid> |
| 56 | 删除: | |
| 57 | 57 | <TextBlock Text="图标" Margin="0,10,0,0"/> |
| 58 | 58 | <base:IconSelect URL="{Binding EditIconFile,Mode=TwoWay}" HorizontalAlignment="Left" Margin="0,10,0,0" /> |
| 59 | 新增: <base:View Condition="=0" Value="{Binding ShowType.Id}"> | |
| 60 | 新增: <StackPanel> | |
| 61 | 新增: <Border Margin="0,10,0,0"> | |
| 62 | 新增: <toggle:Toggle IsChecked="{Binding EditIsDirectoryMath,Mode=TwoWay}" TextPosition="Left" OnText="目录匹配" OffText="目录匹配"></toggle:Toggle> | |
| 63 | 新增: </Border> | |
| 64 | 新增: <base:View Condition="True" Value="{Binding EditIsDirectoryMath}"> | |
| 65 | 新增: <StackPanel Margin="0,10,0,0"> | |
| 66 | 新增: <Button:Button HorizontalAlignment="Right" Width="100" Command="{Binding AddDirectoryCommand}">添加目录</Button:Button> | |
| 67 | 新增: <list:BaseList Items="{Binding EditDirectories}" SelectedItem="{Binding EditSelectedDirectory,Mode=TwoWay}"> | |
| 68 | 新增: <list:BaseList.ContextMenu> | |
| 69 | 新增: <ContextMenu> | |
| 70 | 新增: <MenuItem Header="移除" Command="{Binding DirectoriesCommand}" CommandParameter="remove"/> | |
| 71 | 新增: </ContextMenu> | |
| 72 | 新增: </list:BaseList.ContextMenu> | |
| 73 | 新增: </list:BaseList> | |
| 74 | 新增: </StackPanel> | |
| 75 | 新增: </base:View> | |
| 76 | 新增: </StackPanel> | |
| 77 | 新增: </base:View> | |
| 78 | 新增: | |
| 79 | 新增: | |
| 59 | 80 | </StackPanel> |
| 60 | 81 | </ScrollViewer> |
| 61 | 82 | <Button:Button Grid.Row="2" HorizontalAlignment="Right" Text="?创建:更新" Value="{Binding IsCreate}" Width="120" Margin="0,0,10,0" VerticalAlignment="Center" Command="{Binding EditDoneCommand}"> |
| @@ -112,121 +133,130 @@ | ||
| 112 | 133 | </TabControl.Resources> |
| 113 | 134 | <TabItem> |
| 114 | 135 | <!--应用分类--> |
| 115 | 删除: <ScrollViewer> | |
| 116 | 删除: <StackPanel> | |
| 117 | 删除: <base:View Condition="empty" Value="{Binding Data}"> | |
| 118 | 删除: <base:EmptyData/> | |
| 119 | 删除: </base:View> | |
| 120 | 删除: | |
| 121 | 删除: <ListView Margin="10,20,10,0" ItemsSource="{Binding Data}" SelectedItem="{Binding SelectedAppCategoryItem,Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > | |
| 122 | 删除: <i:Interaction.Triggers> | |
| 123 | 删除: <i:EventTrigger EventName="MouseLeftButtonUp"> | |
| 124 | 删除: <i:InvokeCommandAction Command="{Binding GotoListCommand}" | |
| 136 | 新增: <!--<ScrollViewer>--> | |
| 137 | 新增: <!--<StackPanel>--> | |
| 138 | 新增: <Grid> | |
| 139 | 新增: <base:View Condition="empty" Value="{Binding Data}"> | |
| 140 | 新增: <base:EmptyData/> | |
| 141 | 新增: </base:View> | |
| 142 | 新增: | |
| 143 | 新增: <ListView Margin="10,20,10,0" ItemsSource="{Binding Data}" SelectedItem="{Binding SelectedAppCategoryItem,Mode=TwoWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" > | |
| 144 | 新增: <i:Interaction.Triggers> | |
| 145 | 新增: <i:EventTrigger EventName="MouseLeftButtonUp"> | |
| 146 | 新增: <i:InvokeCommandAction Command="{Binding GotoListCommand}" | |
| 125 | 147 | CommandParameter="{Binding SelectedAppCategoryItem}" /> |
| 126 | 删除: </i:EventTrigger> | |
| 127 | 删除: </i:Interaction.Triggers> | |
| 128 | 删除: | |
| 129 | 删除: <ListView.ContextMenu> | |
| 130 | 删除: <ContextMenu> | |
| 131 | 删除: <MenuItem Header="查看分类应用列表" Command="{Binding GotoListCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 132 | 删除: | |
| 133 | 删除: <MenuItem Header="编辑" Command="{Binding EditCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 134 | 删除: <MenuItem Header="删除分类" Command="{Binding DelCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 135 | 删除: </ContextMenu> | |
| 136 | 删除: </ListView.ContextMenu> | |
| 137 | 删除: <ListBox.Resources> | |
| 138 | 删除: <converter:HextoColorConverter x:Key="HextoColorConverter"/> | |
| 139 | 删除: | |
| 140 | 删除: <Style TargetType="{x:Type ListView}"> | |
| 141 | 删除: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 142 | 删除: | |
| 143 | 删除: <Setter Property="Template"> | |
| 144 | 删除: <Setter.Value> | |
| 145 | 删除: <ControlTemplate TargetType="{x:Type ListView}"> | |
| 148 | 新增: </i:EventTrigger> | |
| 149 | 新增: </i:Interaction.Triggers> | |
| 150 | 新增: | |
| 151 | 新增: <ListView.ContextMenu> | |
| 152 | 新增: <ContextMenu> | |
| 153 | 新增: <MenuItem Header="查看分类应用列表" Command="{Binding GotoListCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 154 | 新增: | |
| 155 | 新增: <MenuItem Header="编辑" Command="{Binding EditCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 156 | 新增: <MenuItem Header="删除分类" Command="{Binding DelCommand}" CommandParameter="{Binding SelectedAppCategoryItem}"/> | |
| 157 | 新增: </ContextMenu> | |
| 158 | 新增: </ListView.ContextMenu> | |
| 159 | 新增: <ListBox.Resources> | |
| 160 | 新增: <converter:HextoColorConverter x:Key="HextoColorConverter"/> | |
| 161 | 新增: | |
| 162 | 新增: <Style TargetType="{x:Type ListView}"> | |
| 163 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 164 | 新增: | |
| 165 | 新增: <Setter Property="Template"> | |
| 166 | 新增: <Setter.Value> | |
| 167 | 新增: <ControlTemplate TargetType="{x:Type ListView}"> | |
| 168 | 新增: <ScrollViewer> | |
| 146 | 169 | <Border> |
| 147 | 170 | <ItemsPresenter /> |
| 148 | 171 | </Border> |
| 149 | 删除: </ControlTemplate> | |
| 150 | 删除: </Setter.Value> | |
| 151 | 删除: </Setter> | |
| 152 | 删除: </Style> | |
| 153 | 删除: <Style TargetType="{x:Type ListViewItem}"> | |
| 154 | 删除: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 155 | 删除: <Setter Property="Template"> | |
| 156 | 删除: <Setter.Value> | |
| 157 | 删除: <ControlTemplate TargetType="{x:Type ListViewItem}"> | |
| 158 | 删除: <Grid> | |
| 159 | 删除: <Border BorderBrush="{Binding ElementName=Border,Path=BorderBrush}" BorderThickness="{Binding ElementName=Border,Path=BorderThickness}" Margin="{Binding ElementName=Border,Path=Margin}" CornerRadius="{Binding ElementName=Border,Path=CornerRadius}"> | |
| 160 | 删除: <Border.Effect> | |
| 161 | 删除: <DropShadowEffect Color="#d8d2d2" BlurRadius="10" Direction="300" ShadowDepth="4" Opacity="0.1" RenderingBias="Performance" ></DropShadowEffect> | |
| 162 | 删除: </Border.Effect> | |
| 163 | 删除: </Border> | |
| 164 | 删除: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{DynamicResource StandardBackgroundBrush}" Margin="5" CornerRadius="20"> | |
| 165 | 删除: <ContentPresenter/> | |
| 166 | 删除: </Border> | |
| 167 | 删除: </Grid> | |
| 168 | 删除: | |
| 169 | 删除: <ControlTemplate.Triggers> | |
| 170 | 删除: <Trigger Property="IsMouseOver" Value="True"> | |
| 171 | 删除: <!--<Setter TargetName="Border" Property="Background" Value="#FFE8E6FF"/>--> | |
| 172 | 删除: <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ThemeBrush}"/> | |
| 173 | 删除: | |
| 174 | 删除: </Trigger> | |
| 175 | 删除: </ControlTemplate.Triggers> | |
| 176 | 删除: </ControlTemplate> | |
| 177 | 删除: </Setter.Value> | |
| 178 | 删除: </Setter> | |
| 179 | 删除: | |
| 180 | 删除: </Style> | |
| 181 | 删除: </ListBox.Resources> | |
| 182 | 删除: <ListBox.ItemsPanel> | |
| 183 | 删除: <ItemsPanelTemplate> | |
| 184 | 删除: <WrapPanel/> | |
| 185 | 删除: </ItemsPanelTemplate> | |
| 186 | 删除: </ListBox.ItemsPanel> | |
| 187 | 删除: <ListView.ItemTemplate> | |
| 188 | 删除: <DataTemplate> | |
| 189 | 删除: | |
| 190 | 删除: | |
| 191 | 删除: <WrapPanel Orientation="Vertical"> | |
| 192 | 删除: <Border Width="150" Height="150"> | |
| 193 | 删除: | |
| 172 | 新增: </ScrollViewer> | |
| 173 | 新增: </ControlTemplate> | |
| 174 | 新增: </Setter.Value> | |
| 175 | 新增: </Setter> | |
| 176 | 新增: </Style> | |
| 177 | 新增: <Style TargetType="{x:Type ListViewItem}"> | |
| 178 | 新增: <Setter Property="OverridesDefaultStyle" Value="True"/> | |
| 179 | 新增: <Setter Property="Template"> | |
| 180 | 新增: <Setter.Value> | |
| 181 | 新增: <ControlTemplate TargetType="{x:Type ListViewItem}"> | |
| 194 | 182 | <Grid> |
| 195 | 删除: <Grid.RowDefinitions> | |
| 196 | 删除: <RowDefinition Height="40"/> | |
| 197 | 删除: | |
| 198 | 删除: <RowDefinition Height="40"/> | |
| 199 | 删除: <RowDefinition Height="30"/> | |
| 200 | 删除: <RowDefinition Height="*"/> | |
| 183 | 新增: <Border BorderBrush="{Binding ElementName=Border,Path=BorderBrush}" BorderThickness="{Binding ElementName=Border,Path=BorderThickness}" Margin="{Binding ElementName=Border,Path=Margin}" CornerRadius="{Binding ElementName=Border,Path=CornerRadius}"> | |
| 184 | 新增: <Border.Effect> | |
| 185 | 新增: <DropShadowEffect Color="#d8d2d2" BlurRadius="10" Direction="300" ShadowDepth="4" Opacity="0.1" RenderingBias="Performance" ></DropShadowEffect> | |
| 186 | 新增: </Border.Effect> | |
| 187 | 新增: </Border> | |
| 188 | 新增: <Border BorderBrush="Transparent" BorderThickness="2" x:Name="Border" Background="{DynamicResource StandardBackgroundBrush}" Margin="5" CornerRadius="20"> | |
| 189 | 新增: <ContentPresenter/> | |
| 190 | 新增: </Border> | |
| 191 | 新增: </Grid> | |
| 201 | 192 | |
| 202 | 删除: </Grid.RowDefinitions> | |
| 203 | 删除: <Rectangle HorizontalAlignment="Left" Margin="10,0,0,0" VerticalAlignment="Center" RadiusX="20" RadiusY="20" Width="15" Height="15" Fill="{Binding Data.Color,Converter={StaticResource HextoColorConverter}}"/> | |
| 204 | 删除: <Grid Grid.Row="1"> | |
| 193 | 新增: <ControlTemplate.Triggers> | |
| 194 | 新增: <Trigger Property="IsMouseOver" Value="True"> | |
| 195 | 新增: <!--<Setter TargetName="Border" Property="Background" Value="#FFE8E6FF"/>--> | |
| 196 | 新增: <Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource ThemeBrush}"/> | |
| 197 | 新增: | |
| 198 | 新增: </Trigger> | |
| 199 | 新增: </ControlTemplate.Triggers> | |
| 200 | 新增: </ControlTemplate> | |
| 201 | 新增: </Setter.Value> | |
| 202 | 新增: </Setter> | |
| 203 | 新增: | |
| 204 | 新增: </Style> | |
| 205 | 新增: </ListBox.Resources> | |
| 206 | 新增: <ListBox.ItemsPanel> | |
| 207 | 新增: <ItemsPanelTemplate> | |
| 208 | 新增: <WrapPanel/> | |
| 209 | 新增: </ItemsPanelTemplate> | |
| 210 | 新增: </ListBox.ItemsPanel> | |
| 211 | 新增: <ListView.ItemTemplate> | |
| 212 | 新增: <DataTemplate> | |
| 213 | 新增: | |
| 214 | 新增: | |
| 215 | 新增: <WrapPanel Orientation="Vertical"> | |
| 216 | 新增: <Border Width="160" Height="160"> | |
| 217 | 新增: | |
| 218 | 新增: <Grid> | |
| 219 | 新增: <Grid.RowDefinitions> | |
| 220 | 新增: <RowDefinition Height="50"/> | |
| 221 | 新增: | |
| 222 | 新增: <RowDefinition Height="40"/> | |
| 223 | 新增: <RowDefinition Height="30"/> | |
| 224 | 新增: <RowDefinition Height="*"/> | |
| 225 | 新增: | |
| 226 | 新增: </Grid.RowDefinitions> | |
| 227 | 新增: <Rectangle HorizontalAlignment="Left" Margin="10" VerticalAlignment="Top" RadiusX="20" RadiusY="20" Width="15" Height="15" Fill="{Binding Data.Color,Converter={StaticResource HextoColorConverter}}"/> | |
| 228 | 新增: <base:View Value="{Binding Data.IsDirectoryMath}"> | |
| 229 | 新增: <Border Background="{DynamicResource ThemeBrush}" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="10" Padding="8,0" CornerRadius="10" Height="20"> | |
| 230 | 新增: <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="10" Foreground="White" Text="目录匹配"></TextBlock> | |
| 231 | 新增: </Border> | |
| 232 | 新增: </base:View> | |
| 233 | 新增: <Grid Grid.Row="1"> | |
| 205 | 234 | |
| 206 | 删除: <base:Img Radius="8" Width="40" Height="40" URL="{Binding Data.IconFile}"/> | |
| 207 | 删除: </Grid> | |
| 208 | 删除: <TextBlock Foreground="{DynamicResource StandardTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Text="{Binding Data.Name}" FontSize="14"/> | |
| 235 | 新增: <base:Img Radius="8" Width="40" Height="40" URL="{Binding Data.IconFile}"/> | |
| 236 | 新增: </Grid> | |
| 237 | 新增: <TextBlock Foreground="{DynamicResource StandardTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="2" Text="{Binding Data.Name}" FontSize="14" FontWeight="Bold"/> | |
| 209 | 238 | |
| 210 | 删除: <Border Grid.Row="3" > | |
| 211 | 删除: <Border Margin="10,0,10,0" CornerRadius="10" Background="{DynamicResource CategoryAppNumBgBrush}" HorizontalAlignment="Right" VerticalAlignment="Center" Padding="10,5"> | |
| 212 | 删除: <TextBlock Foreground="{DynamicResource DefaultTextBrush}"> | |
| 239 | 新增: <Border Grid.Row="3" > | |
| 240 | 新增: <Border Margin="10,0,10,0" CornerRadius="10" Background="{DynamicResource CategoryAppNumBgBrush}" HorizontalAlignment="Right" VerticalAlignment="Center" Padding="10,5" ToolTip="分类应用数量"> | |
| 241 | 新增: <TextBlock Foreground="{DynamicResource DefaultTextBrush}"> | |
| 213 | 242 | <Run Text="×"/> |
| 214 | 243 | |
| 215 | 244 | <Run Text="{Binding Count}"/> |
| 216 | 删除: </TextBlock> | |
| 217 | 删除: | |
| 218 | 删除: </Border> | |
| 245 | 新增: </TextBlock> | |
| 219 | 246 | |
| 220 | 247 | </Border> |
| 221 | 删除: </Grid> | |
| 222 | 删除: </Border> | |
| 223 | 248 | |
| 224 | 删除: </WrapPanel> | |
| 225 | 删除: </DataTemplate> | |
| 226 | 删除: </ListView.ItemTemplate> | |
| 227 | 删除: </ListView> | |
| 228 | 删除: </StackPanel> | |
| 229 | 删除: </ScrollViewer> | |
| 249 | 新增: </Border> | |
| 250 | 新增: </Grid> | |
| 251 | 新增: </Border> | |
| 252 | 新增: | |
| 253 | 新增: </WrapPanel> | |
| 254 | 新增: </DataTemplate> | |
| 255 | 新增: </ListView.ItemTemplate> | |
| 256 | 新增: </ListView> | |
| 257 | 新增: </Grid> | |
| 258 | 新增: <!--</StackPanel>--> | |
| 259 | 新增: <!--</ScrollViewer>--> | |
| 230 | 260 | </TabItem> |
| 231 | 261 | <TabItem> |
| 232 | 262 | <!--网页分类--> |

