Skip to content
32 changes: 15 additions & 17 deletions src/Files.Uwp/Interacts/BaseLayoutCommandImplementationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,23 @@ public virtual void SetAsLockscreenBackgroundItem(RoutedEventArgs e)

public virtual async void SetAsDesktopBackgroundItem(RoutedEventArgs e)
{
if (SlimContentPage.SelectedItems.Count > 1)
{
var images = (from o in SlimContentPage.SelectedItems select o.ItemPath).ToArray();
WallpaperHelpers.SetAsBackground(WallpaperType.Desktop, SlimContentPage.SelectedItem.ItemPath);
}

var connection = await AppServiceConnectionHelper.Instance;
if (connection != null)
{
var value = new ValueSet
{
{ "Arguments", "WallpaperOperation" },
{ "wallpaperop", "SetSlideshow" },
{ "filepaths", images }
};
await connection.SendMessageAsync(value);
}
}
else
public virtual async void SetAsSlideshowItem(RoutedEventArgs e)
{
var images = (from o in SlimContentPage.SelectedItems select o.ItemPath).ToArray();

var connection = await AppServiceConnectionHelper.Instance;
if (connection != null)
{
WallpaperHelpers.SetAsBackground(WallpaperType.Desktop, SlimContentPage.SelectedItem.ItemPath);
var value = new ValueSet
{
{ "Arguments", "WallpaperOperation" },
{ "wallpaperop", "SetSlideshow" },
{ "filepaths", images }
};
await connection.SendMessageAsync(value);
}
}

Expand Down
3 changes: 3 additions & 0 deletions src/Files.Uwp/Interacts/BaseLayoutCommandsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private void InitializeCommands()
CreateShortcutCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.CreateShortcut);
SetAsLockscreenBackgroundItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsLockscreenBackgroundItem);
SetAsDesktopBackgroundItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsDesktopBackgroundItem);
SetAsSlideshowItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SetAsSlideshowItem);
RunAsAdminCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.RunAsAdmin);
RunAsAnotherUserCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.RunAsAnotherUser);
SidebarPinItemCommand = new RelayCommand<RoutedEventArgs>(CommandsModel.SidebarPinItem);
Expand Down Expand Up @@ -90,6 +91,8 @@ private void InitializeCommands()

public ICommand SetAsDesktopBackgroundItemCommand { get; private set; }

public ICommand SetAsSlideshowItemCommand { get; private set; }

public ICommand RunAsAdminCommand { get; private set; }

public ICommand RunAsAnotherUserCommand { get; private set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public interface IBaseLayoutCommandImplementationModel : IDisposable

void SetAsDesktopBackgroundItem(RoutedEventArgs e);

void SetAsSlideshowItem(RoutedEventArgs e);

void RunAsAdmin(RoutedEventArgs e);

void RunAsAnotherUser(RoutedEventArgs e);
Expand Down
637 changes: 435 additions & 202 deletions src/Files.Uwp/ResourceDictionaries/ToolbarButtonStyle.xaml

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions src/Files.Uwp/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -2672,9 +2672,6 @@ We use App Center to track which settings are being used, find bugs, and fix cra
<data name="RunWithPowerShell" xml:space="preserve">
<value>Run with PowerShell</value>
</data>
<data name="SetAsBackground" xml:space="preserve">
<value>Set as desktop background</value>
</data>
<data name="ShowFolderSizesWarning" xml:space="preserve">
<value>Calculating folder sizes is resource intensive and may cause your CPU usage to increase.</value>
</data>
Expand Down Expand Up @@ -2786,6 +2783,15 @@ We use App Center to track which settings are being used, find bugs, and fix cra
<data name="ReviewFilesContent" xml:space="preserve">
<value>Would you like to review Files?</value>
</data>
<data name="SetAsBackgroundFlyout" xml:space="preserve">
<value>Set as background</value>
</data>
<data name="SetAsLockscreen" xml:space="preserve">
<value>Set as lockscreen</value>
</data>
<data name="SetAsBackground" xml:space="preserve">
<value>Set as desktop background</value>
</data>
<data name="SetAsDefault" xml:space="preserve">
<value>Set as default</value>
</data>
Expand All @@ -2807,4 +2813,7 @@ We use App Center to track which settings are being used, find bugs, and fix cra
<data name="DisplayTypeColumn" xml:space="preserve">
<value>Display Type column</value>
</data>
<data name="Lockscreen" xml:space="preserve">
<value>Lockscreen</value>
</data>
</root>
Loading