-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Farewell, Interaction]: Step 1 of removing the Interaction class (#4016
) * rm1 * Use BaseLayoutCommandsViewModel * Fix build * Fix build 2 * Remove event handlers in favour of binding * Fix commands not being bound * Made functions in BaseLayoutCommandImplementationModel virtual * Fixed build error * Remove region directives from FileProperties * Fix build error Co-authored-by: d2dyno006 <[email protected]>
- Loading branch information
Showing
26 changed files
with
784 additions
and
359 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Reflection; | ||
|
||
namespace Files.Extensions | ||
{ | ||
public static class EnumExtensions | ||
{ | ||
public static TEnum GetEnum<TEnum>(string text) where TEnum : struct | ||
{ | ||
if (!typeof(TEnum).GetTypeInfo().IsEnum) | ||
{ | ||
throw new InvalidOperationException("Generic parameter 'TEnum' must be an enum."); | ||
} | ||
return (TEnum)Enum.Parse(typeof(TEnum), text); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using System; | ||
using Microsoft.Toolkit.Uwp; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using Windows.ApplicationModel.Core; | ||
using Windows.Foundation.Collections; | ||
using Windows.UI.Core; | ||
|
||
namespace Files.Helpers | ||
{ | ||
public static class QuickLookHelpers | ||
{ | ||
public static async void ToggleQuickLook(IShellPage associatedInstance) | ||
{ | ||
try | ||
{ | ||
if (associatedInstance.SlimContentPage.IsItemSelected && !associatedInstance.SlimContentPage.IsRenamingItem) | ||
{ | ||
Debug.WriteLine("Toggle QuickLook"); | ||
if (associatedInstance.ServiceConnection != null) | ||
{ | ||
await associatedInstance.ServiceConnection.SendMessageAsync(new ValueSet() | ||
{ | ||
{ "path", associatedInstance.SlimContentPage.SelectedItem.ItemPath }, | ||
{ "Arguments", "ToggleQuickLook" } | ||
}); | ||
} | ||
} | ||
} | ||
catch (FileNotFoundException) | ||
{ | ||
await DialogDisplayHelper.ShowDialogAsync("FileNotFoundDialog/Title".GetLocalized(), "FileNotFoundPreviewDialog/Text".GetLocalized()); | ||
associatedInstance.NavigationToolbar.CanRefresh = false; | ||
await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => | ||
{ | ||
var ContentOwnedViewModelInstance = associatedInstance.FilesystemViewModel; | ||
ContentOwnedViewModelInstance?.RefreshItems(null); | ||
}); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
using Files.Filesystem; | ||
using System.Collections.Generic; | ||
|
||
namespace Files.Helpers | ||
{ | ||
public static class SidebarHelpers | ||
{ | ||
public static void UnpinItems(List<ListedItem> itemsToUnpin) | ||
{ | ||
foreach (var item in itemsToUnpin) | ||
{ | ||
App.SidebarPinnedController.Model.RemoveItem(item.ItemPath); | ||
} | ||
} | ||
|
||
public static void PinItems(List<ListedItem> itemsToPin) | ||
{ | ||
foreach (ListedItem listedItem in itemsToPin) | ||
{ | ||
App.SidebarPinnedController.Model.AddItem(listedItem.ItemPath); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.