From 8db7405e835324e25bb3be7190325d929dd8c232 Mon Sep 17 00:00:00 2001 From: Soham Das Date: Tue, 9 Apr 2024 14:03:24 -0700 Subject: [PATCH] Addressed PR comments --- .../OptimizeDevDriveDialogViewModel.cs | 8 ++--- .../Views/DevDriveInsightsPage.xaml | 33 ++++++++----------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/tools/Customization/DevHome.Customization/ViewModels/DevDriveInsights/OptimizeDevDriveDialogViewModel.cs b/tools/Customization/DevHome.Customization/ViewModels/DevDriveInsights/OptimizeDevDriveDialogViewModel.cs index a87f2804bb..57f084fd20 100644 --- a/tools/Customization/DevHome.Customization/ViewModels/DevDriveInsights/OptimizeDevDriveDialogViewModel.cs +++ b/tools/Customization/DevHome.Customization/ViewModels/DevDriveInsights/OptimizeDevDriveDialogViewModel.cs @@ -91,7 +91,7 @@ private async Task BrowseButtonClick(object sender) } } - private int MoveDirectory(string sourceDirectory, string targetDirectory) + private bool MoveDirectory(string sourceDirectory, string targetDirectory) { try { @@ -123,13 +123,13 @@ private int MoveDirectory(string sourceDirectory, string targetDirectory) // Delete the source directory Directory.Delete(sourceDirectory, true); - return 0; + return true; } catch (Exception ex) { Log.Error($"Error in MoveDirectory. Error: {ex}"); TelemetryFactory.Get().LogError("DevDriveInsights_PackageCacheMoveDirectory_Error", LogLevel.Critical, new ExceptionEvent(ex.HResult, sourceDirectory)); - return ex.HResult; + return false; } } @@ -169,7 +169,7 @@ private void DirectoryInputConfirmed() // TODO: If chosen folder not a dev drive location, currently we no-op and log the error. Instead we should display the error. if (ChosenDirectoryInDevDrive(directoryPath)) { - if (MoveDirectory(ExistingCacheLocation, directoryPath) == 0) + if (MoveDirectory(ExistingCacheLocation, directoryPath)) { SetEnvironmentVariable(EnvironmentVariableToBeSet, directoryPath); Log.Debug($"Moved cache from {ExistingCacheLocation} to {directoryPath}"); diff --git a/tools/Customization/DevHome.Customization/Views/DevDriveInsightsPage.xaml b/tools/Customization/DevHome.Customization/Views/DevDriveInsightsPage.xaml index 60b13945da..51b0f534d1 100644 --- a/tools/Customization/DevHome.Customization/Views/DevDriveInsightsPage.xaml +++ b/tools/Customization/DevHome.Customization/Views/DevDriveInsightsPage.xaml @@ -1,20 +1,15 @@ - - - - - - - - - - - - - + xmlns:views="using:DevHome.Customization.Views" + behaviors:NavigationViewHeaderBehavior.HeaderTemplate="{StaticResource BreadcrumbBarDataTemplate}" + behaviors:NavigationViewHeaderBehavior.HeaderContext="{x:Bind ViewModel}"> + + + + + + +