Skip to content
Merged
1 change: 1 addition & 0 deletions Files/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<ResourceDictionary>
<fsvm:FolderLayoutInformation x:Key="DetailsInfo" Mode="DetailsView" />
<fsvm:FolderLayoutInformation x:Key="TilesInfo" Mode="TilesView" />
<fsvm:FolderLayoutInformation x:Key="ColumnInfo" Mode="ColumnView" />
<fsvm:FolderLayoutInformation
x:Key="SmallGridInfo"
Mode="GridView"
Expand Down
1 change: 1 addition & 0 deletions Files/Enums/FolderLayout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ public enum FolderLayout
DetailsView = 0,
TilesView = 1,
GridViewSmall = 2,
ColumnView = 3,
GridViewMedium = 4,
GridViewLarge = 8
}
Expand Down
1 change: 1 addition & 0 deletions Files/Enums/FolderLayoutModes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ public enum FolderLayoutModes
{
DetailsView = 1,
TilesView = 2,
ColumnView = 3,
GridView = 4,
}
}
7 changes: 7 additions & 0 deletions Files/Files.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,9 @@
<Compile Include="ViewModels\SettingsViewModels\OnStartupViewModel.cs" />
<Compile Include="ViewModels\SettingsViewModels\PreferencesViewModel.cs" />
<Compile Include="ViewModels\SettingsViewModels\WidgetsViewModel.cs" />
<Compile Include="Views\LayoutModes\ColumnViewBrowser.xaml.cs">
<DependentUpon>ColumnViewBrowser.xaml</DependentUpon>
</Compile>
<Compile Include="Views\PaneHolderPage.xaml.cs">
<DependentUpon>PaneHolderPage.xaml</DependentUpon>
</Compile>
Expand Down Expand Up @@ -885,6 +888,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Views\LayoutModes\ColumnViewBrowser.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Views\PaneHolderPage.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
Expand Down
7 changes: 6 additions & 1 deletion Files/Strings/en-US/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -1944,11 +1944,16 @@
<data name="FullTrustStatusTeachingTip.Title" xml:space="preserve">
<value>Administrator</value>
</data>
<data name="NavToolbarColumnView.AutomationProperties.Name" xml:space="preserve">
<value>Column View</value>
</data>
<data name="NavToolbarColumnView.ToolTipService.ToolTip" xml:space="preserve">
<value>Column View</value>
</data>
<data name="PinItemToStart.Text" xml:space="preserve">
<value>Pin to the Start Menu</value>
</data>
<data name="UnpinItemFromStart.Text" xml:space="preserve">
<value>Unpin from the Start Menu</value>
</data>

</root>
15 changes: 15 additions & 0 deletions Files/UserControls/NavigationToolbar.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -1089,6 +1089,21 @@
FontSize="16"
Glyph="&#xE739;" />
</RadioButton>
<RadioButton
x:Uid="NavToolbarColumnView"
Height="32"
MinWidth="0"
Command="{x:Bind ToggleLayoutModeColumnView}"
CommandParameter="{xh:SystemTypeToXaml Bool=True}"
CornerRadius="4"
IsChecked="{x:Bind LayoutModeInformation, Converter={StaticResource LayoutModeConverter}, Mode=OneWay, ConverterParameter=ColumnInfo}"
Style="{StaticResource ToggleButtonRevealStyle}"
ToolTipService.ToolTip="Column View">
<FontIcon
Margin="0,2,0,0"
FontSize="16"
Glyph="&#xE8C0;" />
</RadioButton>
</StackPanel>
</StackPanel>
</Flyout>
Expand Down
19 changes: 19 additions & 0 deletions Files/UserControls/NavigationToolbar.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,26 @@ public ICommand ToggleLayoutModeGridViewLarge
SetValue(ToggleLayoutModeGridViewLargeProperty, value);
}
}
public static readonly DependencyProperty ToggleLayoutModeColumnViewProperty = DependencyProperty.Register(
"ToggleLayoutModeColumnView",
typeof(ICommand),
typeof(NavigationToolbar),
new PropertyMetadata(null)
);

public ICommand ToggleLayoutModeColumnView
{
get
{
return (ICommand)GetValue(ToggleLayoutModeColumnViewProperty);
}
set
{
SetValue(ToggleLayoutModeColumnViewProperty, value);
}
}

#endregion
#endregion Layout Options

public static readonly DependencyProperty IsPageTypeNotHomeProperty = DependencyProperty.Register(
Expand Down
25 changes: 25 additions & 0 deletions Files/ViewModels/FolderSettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public Type GetLayoutType(string folderPath)
case FolderLayoutModes.GridView:
type = typeof(GridViewBrowser);
break;
case FolderLayoutModes.ColumnView:
type = typeof(ColumnViewBrowser);
break;

default:
type = typeof(GenericFileBrowser);
Expand Down Expand Up @@ -172,6 +175,28 @@ public void SwitchAdaptiveLayout(bool enable)
LayoutModeChangeRequested?.Invoke(this, new LayoutModeEventArgs(LayoutMode, GridViewSize));
});

public RelayCommand<bool> ToggleLayoutModeColumnView => new RelayCommand<bool>((manuallySet) =>
{
if (App.AppSettings.AreLayoutPreferencesPerFolder && App.AppSettings.AdaptiveLayoutEnabled)
{
if (LastLayoutModeSelected == FolderLayout.ColumnView)
{
return;
}
else if (manuallySet)
{
// Override preferred layout mode
SwitchAdaptiveLayout(false);
}
}

LayoutMode = FolderLayoutModes.ColumnView; // Column View// Size

LastLayoutModeSelected = FolderLayout.ColumnView;

LayoutModeChangeRequested?.Invoke(this, new LayoutModeEventArgs(LayoutMode, GridViewSize));
});

public RelayCommand<bool> ToggleLayoutModeGridViewMedium => new RelayCommand<bool>((manuallySet) =>
{
if (App.AppSettings.AreLayoutPreferencesPerFolder && App.AppSettings.AdaptiveLayoutEnabled)
Expand Down
22 changes: 22 additions & 0 deletions Files/Views/LayoutModes/ColumnViewBrowser.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<local:BaseLayout
x:Class="Files.Views.LayoutModes.ColumnViewBrowser"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Files"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
mc:Ignorable="d">

<local:BaseLayout.Resources>
<Style TargetType="controls:BladeItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="TitleBarVisibility" Value="Collapsed"></Setter>
<Setter Property="BorderThickness" Value="0,0,1,0"></Setter>
</Style>
</local:BaseLayout.Resources>
<Grid>
<controls:BladeView x:Name="ColumnHost">
<controls:BladeItem x:Name="FirstBlade"/>
</controls:BladeView>
</Grid>
</local:BaseLayout>
138 changes: 138 additions & 0 deletions Files/Views/LayoutModes/ColumnViewBrowser.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
using Files.EventArguments;
using Files.Filesystem;
using Files.Interacts;
using Files.ViewModels;
using Microsoft.Toolkit.Uwp.UI.Controls;
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace Files.Views.LayoutModes
{
/// <summary>
/// An empty page that can be used on its own or navigated to within a Frame.
/// </summary>
public sealed partial class ColumnViewBrowser : BaseLayout
{
private List<Frame> Frames;
private string NavParam;

public ColumnViewBrowser()
{
this.InitializeComponent();
}

protected override async void OnNavigatedTo(NavigationEventArgs eventArgs)
{
base.OnNavigatedTo(eventArgs);
FolderSettings.LayoutModeChangeRequested -= FolderSettings_LayoutModeChangeRequested;
FolderSettings.LayoutModeChangeRequested += FolderSettings_LayoutModeChangeRequested;

}

protected override void OnNavigatingFrom(NavigatingCancelEventArgs e)
{
base.OnNavigatingFrom(e);
FolderSettings.LayoutModeChangeRequested -= FolderSettings_LayoutModeChangeRequested;
}

private void FolderSettings_LayoutModeChangeRequested(object sender, LayoutModeEventArgs e)
{

}

public override void SelectAllItems()
{
// throw new NotImplementedException();
}

public override void FocusFileList()
{

}

protected override IEnumerable GetAllItems()
{
return null;
}

protected override void AddSelectedItem(ListedItem item)
{

}

public override void InvertSelection()
{
// throw new NotImplementedException();
}

public override void ClearSelection()
{
// throw new NotImplementedException();
}

public override void SetDragModeForItems()
{
// throw new NotImplementedException();
}

public override void ScrollIntoView(ListedItem item)
{
// throw new NotImplementedException();
}

public override void SetSelectedItemOnUi(ListedItem selectedItem)
{
// throw new NotImplementedException();
}

public override void SetSelectedItemsOnUi(List<ListedItem> selectedItems)
{
// throw new NotImplementedException();
}

public override void AddSelectedItemsOnUi(List<ListedItem> selectedItems)
{
// throw new NotImplementedException();
}

public override void FocusSelectedItems()
{
// throw new NotImplementedException();
}

public override void StartRenameItem()
{
// throw new NotImplementedException();
}

public override void ResetItemOpacity()
{
// throw new NotImplementedException();
}

public override void SetItemOpacity(ListedItem item)
{
// throw new NotImplementedException();
}

protected override ListedItem GetItemFromElement(object element)
{
throw new NotImplementedException();
}
}
}
9 changes: 9 additions & 0 deletions Files/Views/LayoutModes/GenericFileBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@
<FontIcon Glyph="&#xE179;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem
x:Uid="BaseLayoutContextFlyoutColumn"
Command="{x:Bind FolderSettings.ToggleLayoutModeColumnView}"
CommandParameter="{xh:SystemTypeToXaml Bool=True}"
Text="Column View">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xE8C0;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyoutSubItem>
<MenuFlyoutItem
x:Name="RefreshEmptySpace"
Expand Down
9 changes: 9 additions & 0 deletions Files/Views/LayoutModes/GridViewBrowser.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,15 @@
<FontIcon Glyph="&#xE179;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
<MenuFlyoutItem
x:Uid="BaseLayoutContextFlyoutColumn"
Command="{x:Bind FolderSettings.ToggleLayoutModeColumnView}"
CommandParameter="{xh:SystemTypeToXaml Bool=True}"
Text="Column View">
<MenuFlyoutItem.Icon>
<FontIcon Glyph="&#xE8C0;" />
</MenuFlyoutItem.Icon>
</MenuFlyoutItem>
</MenuFlyoutSubItem>
<MenuFlyoutItem
x:Name="RefreshEmptySpace"
Expand Down
1 change: 1 addition & 0 deletions Files/Views/ModernShellPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@
ToggleLayoutModeGridViewSmall="{x:Bind FolderSettings.ToggleLayoutModeGridViewSmall}"
ToggleLayoutModeGridViewMedium="{x:Bind FolderSettings.ToggleLayoutModeGridViewMedium}"
ToggleLayoutModeGridViewLarge="{x:Bind FolderSettings.ToggleLayoutModeGridViewLarge}"
ToggleLayoutModeColumnView="{x:Bind FolderSettings.ToggleLayoutModeColumnView}"

AreKeyboardAcceleratorsEnabled="{x:Bind IsCurrentInstance, Mode=OneWay}"
CanCopyPathInPage="{x:Bind InstanceViewModel.CanCopyPathInPage, Mode=OneWay}"
Expand Down