diff --git a/TagsTree/Views/FilePropertiesPage.xaml.cs b/TagsTree/Views/FilePropertiesPage.xaml.cs index 6c65d2c..47fbe89 100644 --- a/TagsTree/Views/FilePropertiesPage.xaml.cs +++ b/TagsTree/Views/FilePropertiesPage.xaml.cs @@ -6,10 +6,10 @@ using Microsoft.UI.Xaml.Input; using Microsoft.UI.Xaml.Media.Animation; using Microsoft.UI.Xaml.Navigation; -using Microsoft.VisualBasic.FileIO; using TagsTree.Services; using TagsTree.Services.ExtensionMethods; using TagsTree.ViewModels; +using System.IO; namespace TagsTree.Views; @@ -45,7 +45,7 @@ private async void RenameBClick(object sender, RoutedEventArgs e) } var newFullName = FileViewModel.Path + @"\" + cd.Text; - if (FileViewModel.IsFolder ? FileSystem.DirectoryExists(newFullName) : FileSystem.FileExists(newFullName)) + if (FileViewModel.IsFolder ? Directory.Exists(newFullName) : File.Exists(newFullName)) { var isFolder = FileViewModel.IsFolder ? "夹" : ""; return $"新文件{isFolder}名与目录中其他文件{isFolder}同名!"; @@ -58,6 +58,7 @@ private async void RenameBClick(object sender, RoutedEventArgs e) var newFullName = FileViewModel.Path + @"\" + InputName.Text; FileViewModel.FileModel.Rename(newFullName); FileViewModel.MoveOrRenameAndSave(newFullName); + // 相当于对FileViewModel的所有属性OnPropertyChanged OnPropertyChanged(nameof(FileViewModel)); } private async void MoveBClick(object sender, RoutedEventArgs e) diff --git a/TagsTree/Views/SettingsPage.xaml b/TagsTree/Views/SettingsPage.xaml index 863f8a7..300f90d 100644 --- a/TagsTree/Views/SettingsPage.xaml +++ b/TagsTree/Views/SettingsPage.xaml @@ -7,19 +7,18 @@ xmlns:local="using:TagsTree.Views" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:root="using:TagsTree" - xmlns:ui="using:CommunityToolkit.WinUI.UI.Controls" Background="Transparent" NavigationCacheMode="Required" mc:Ignorable="d"> - + - + 0 @@ -49,7 +48,7 @@ IsClickEnabled="True" Tapped="BLibraryPath_Click"> - + @@ -58,13 +57,13 @@ Description="将所在路径文件夹名作为标签使用" Header="文件夹标签" HeaderIcon="Tag"> - + - + - -