Skip to content

Commit 5626ac1

Browse files
committed
Start Work on Properties Dialog
1 parent 07b3d91 commit 5626ac1

File tree

10 files changed

+188
-44
lines changed

10 files changed

+188
-44
lines changed

Files UWP/AddItem.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
</Grid>
1919
<Grid Name="SelectionListContent" HorizontalAlignment="Stretch">
2020
<StackPanel>
21-
<ListView IsItemClickEnabled="True" ItemClick="ListView_ItemClick" ItemsSource="{x:Bind local:AddItem.AddItemsList}">
21+
<ListView Name="AddItemsListView" IsItemClickEnabled="True" ItemClick="ListView_ItemClick" ItemsSource="{x:Bind local:AddItem.AddItemsList}">
2222
<ListView.ItemTemplate>
2323
<DataTemplate>
2424
<Grid Height="50">

Files UWP/AddItem.xaml.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,11 @@ namespace Files
1212

1313
public sealed partial class AddItem : Page
1414
{
15+
public static ListView addItemsChoices;
1516
public AddItem()
1617
{
1718
this.InitializeComponent();
19+
addItemsChoices = AddItemsListView;
1820
AddItemsToList();
1921
}
2022

@@ -33,13 +35,13 @@ public static void AddItemsToList()
3335
private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
3436
{
3537

36-
GenericFileBrowser.AddItemBox.Hide();
38+
ProHome.AddItemBox.Hide();
3739
var currentPath = App.ViewModel.Universal.path;
3840
StorageFolder folderToCreateItem = await StorageFolder.GetFolderFromPathAsync(currentPath);
3941
if ((e.ClickedItem as AddListItem).Header == "Folder")
4042
{
41-
await GenericFileBrowser.NameBox.ShowAsync();
42-
var userInput = GenericFileBrowser.inputForRename;
43+
await ProHome.NameBox.ShowAsync();
44+
var userInput = ProHome.inputForRename;
4345
if (userInput != null)
4446
{
4547
var folder = await folderToCreateItem.CreateFolderAsync(userInput, CreationCollisionOption.FailIfExists);
@@ -48,8 +50,8 @@ private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
4850
}
4951
else if ((e.ClickedItem as AddListItem).Header == "Text Document")
5052
{
51-
await GenericFileBrowser.NameBox.ShowAsync();
52-
var userInput = GenericFileBrowser.inputForRename;
53+
await ProHome.NameBox.ShowAsync();
54+
var userInput = ProHome.inputForRename;
5355
if (userInput != null)
5456
{
5557
var folder = await folderToCreateItem.CreateFileAsync(userInput + ".txt", CreationCollisionOption.FailIfExists);
@@ -58,8 +60,8 @@ private async void ListView_ItemClick(object sender, ItemClickEventArgs e)
5860
}
5961
else if ((e.ClickedItem as AddListItem).Header == "Bitmap Image")
6062
{
61-
await GenericFileBrowser.NameBox.ShowAsync();
62-
var userInput = GenericFileBrowser.inputForRename;
63+
await ProHome.NameBox.ShowAsync();
64+
var userInput = ProHome.inputForRename;
6365
if (userInput != null)
6466
{
6567
var folder = await folderToCreateItem.CreateFileAsync(userInput + ".bmp", CreationCollisionOption.FailIfExists);

Files UWP/FilesUWP.csproj

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@
134134
<Compile Include="ProHome.xaml.cs">
135135
<DependentUpon>ProHome.xaml</DependentUpon>
136136
</Compile>
137+
<Compile Include="Properties.xaml.cs">
138+
<DependentUpon>Properties.xaml</DependentUpon>
139+
</Compile>
137140
<Compile Include="Properties\AssemblyInfo.cs" />
138141
<Compile Include="Settings.xaml.cs">
139142
<DependentUpon>Settings.xaml</DependentUpon>
@@ -194,6 +197,10 @@
194197
<SubType>Designer</SubType>
195198
<Generator>MSBuild:Compile</Generator>
196199
</Page>
200+
<Page Include="Properties.xaml">
201+
<SubType>Designer</SubType>
202+
<Generator>MSBuild:Compile</Generator>
203+
</Page>
197204
<Page Include="Settings.xaml">
198205
<SubType>Designer</SubType>
199206
<Generator>MSBuild:Compile</Generator>
@@ -241,7 +248,7 @@
241248
<Version>5.1.0</Version>
242249
</PackageReference>
243250
<PackageReference Include="Microsoft.UI.Xaml">
244-
<Version>2.1.190405004</Version>
251+
<Version>2.1.190405004.1</Version>
245252
</PackageReference>
246253
</ItemGroup>
247254
<ItemGroup>

Files UWP/Interacts/Interaction.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,9 @@ public static async void DeleteItem_Click(object sender, RoutedEventArgs e)
552552

553553
public static async void RenameItem_Click(object sender, RoutedEventArgs e)
554554
{
555-
if(page.Name == "GenericItemView")
555+
ProHome.inputFromRename.Text = "";
556+
557+
if (page.Name == "GenericItemView")
556558
{
557559
try
558560
{

Files UWP/ProHome.xaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
1414
xmlns:converters="using:Microsoft.Toolkit.Uwp.UI.Converters"
1515
xmlns:ex="using:Microsoft.Toolkit.Uwp.UI.Extensions"
16-
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)">
16+
xmlns:Windows10version1809="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 7)"
17+
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)">
1718
<Page.Resources>
1819
<Style x:Key="ListViewHeaderItemStyle1" TargetType="ListViewHeaderItem">
1920
<Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}"/>
@@ -905,9 +906,9 @@
905906
<AppBarSeparator/>
906907
<AppBarButton Click="DeleteButton_Click" Name="DeleteButton" IsEnabled="{x:Bind local:App.HomeItems.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Delete" Icon="Delete"/>
907908
<AppBarButton Click="RenameButton_Click" Name="RenameButton" IsEnabled="{x:Bind local:App.HomeItems.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Rename" Icon="Rename"/>
908-
<AppBarButton Click="AddItem_Click" Name="AddItem" IsEnabled="{x:Bind local:App.AlwaysPresentCommands.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Add Item" Icon="Add"/>
909+
<AppBarButton Click="AddItem_Click" Name="addItemButton" IsEnabled="{x:Bind local:App.AlwaysPresentCommands.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Add Item" Icon="Add"/>
909910
<AppBarSeparator/>
910-
<AppBarButton IsEnabled="{x:Bind local:App.HomeItems.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Properties">
911+
<AppBarButton Click="ShowPropertiesButton_Click" Name="ShowPropertiesButton" IsEnabled="{x:Bind local:App.HomeItems.isEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Label="Properties">
911912
<AppBarButton.Icon>
912913
<FontIcon Glyph="&#xE946;"/>
913914
</AppBarButton.Icon>
@@ -1088,19 +1089,34 @@
10881089
<Frame Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Name="ItemDisplayFrame"/>
10891090

10901091
</SplitView>
1091-
<ContentDialog DefaultButton="Primary" PrimaryButtonClick="PermissionDialog_PrimaryButtonClick" PrimaryButtonText="Grant Permission" Name="PermissionDialog" Title="Welcome to Files UWP">
1092+
<ContentDialog Grid.RowSpan="4" DefaultButton="Primary" PrimaryButtonClick="PermissionDialog_PrimaryButtonClick" PrimaryButtonText="Grant Permission" Name="PermissionDialog" Title="Welcome to Files UWP">
1093+
<Windows10version1903:ContentDialog.Shadow>
1094+
<Windows10version1903:ThemeShadow/>
1095+
</Windows10version1903:ContentDialog.Shadow>
10921096
<Grid>
10931097
<TextBlock TextWrapping="WrapWholeWords" Text="To get started, we need you to grant us permission to show you your files. This will open a Settings page where you can grant us permission. Files will close in the process, so don't be afraid to come back! "/>
10941098
</Grid>
10951099
</ContentDialog>
1096-
<ContentDialog Background="{StaticResource ApplicationPageBackgroundThemeBrush}" BorderThickness="0" Name="AddDialog" PrimaryButtonText="Cancel">
1100+
<ContentDialog Grid.RowSpan="4" Loaded="AddDialog_Loaded" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" BorderThickness="0" Name="AddDialog" PrimaryButtonText="Cancel">
1101+
<Windows10version1903:ContentDialog.Shadow>
1102+
<Windows10version1903:ThemeShadow/>
1103+
</Windows10version1903:ContentDialog.Shadow>
10971104
<Frame Width="450" Name="AddDialogFrame"/>
10981105
</ContentDialog>
1099-
<ContentDialog Background="{StaticResource ApplicationPageBackgroundThemeBrush}" DefaultButton="Primary" Title="Name this item" BorderThickness="0" PrimaryButtonClick="NameDialog_PrimaryButtonClick" Name="NameDialog" PrimaryButtonText="Set Name" SecondaryButtonText="Cancel">
1106+
<ContentDialog Grid.RowSpan="4" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" DefaultButton="Primary" Title="Name this item" BorderThickness="0" SecondaryButtonClick="NameDialog_SecondaryButtonClick" PrimaryButtonClick="NameDialog_PrimaryButtonClick" Name="NameDialog" PrimaryButtonText="Set Name" SecondaryButtonText="Cancel">
1107+
<Windows10version1903:ContentDialog.Shadow>
1108+
<Windows10version1903:ThemeShadow/>
1109+
</Windows10version1903:ContentDialog.Shadow>
11001110
<Grid>
11011111
<TextBox Padding="8" Name="RenameInput" PlaceholderText="Enter an item name without the file extension" Width="300"/>
11021112
</Grid>
11031113
</ContentDialog>
1114+
<ContentDialog Name="PropertiesDialog" Grid.RowSpan="4" CloseButtonText="Cancel" PrimaryButtonText="OK" DefaultButton="Primary" SecondaryButtonText="Apply">
1115+
<Windows10version1903:ContentDialog.Shadow>
1116+
<Windows10version1903:ThemeShadow/>
1117+
</Windows10version1903:ContentDialog.Shadow>
1118+
<Frame Width="400" Height="450" Name="propertiesFrame" />
1119+
</ContentDialog>
11041120

11051121
</Grid>
11061122
</Page>

Files UWP/ProHome.xaml.cs

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Files.Interacts;
1+
using Files.Filesystem;
2+
using Files.Interacts;
23
using Microsoft.UI.Xaml.Controls;
34
using System;
45
using System.Collections.ObjectModel;
@@ -12,8 +13,10 @@
1213
using Windows.UI;
1314
using Windows.UI.Popups;
1415
using Windows.UI.ViewManagement;
16+
using Windows.UI.WindowManagement;
1517
using Windows.UI.Xaml;
1618
using Windows.UI.Xaml.Controls;
19+
using Windows.UI.Xaml.Hosting;
1720
using Windows.UI.Xaml.Input;
1821
using Windows.UI.Xaml.Media;
1922
using Windows.UI.Xaml.Media.Animation;
@@ -66,7 +69,7 @@ public ProHome()
6669
BackButton = Back;
6770
ForwardButton = Forward;
6871
RefreshButton = Refresh;
69-
AddItemButton = AddItem;
72+
AddItemButton = addItemButton;
7073
LocationsList.SelectedIndex = 0;
7174
if (App.Current.RequestedTheme == ApplicationTheme.Dark)
7275
{
@@ -655,6 +658,7 @@ private void RenameButton_Click(object sender, RoutedEventArgs e)
655658

656659
private async void AddItem_Click(object sender, RoutedEventArgs e)
657660
{
661+
AddItem.addItemsChoices.SelectedItem = null;
658662
await ProHome.AddItemBox.ShowAsync();
659663
}
660664

@@ -682,5 +686,30 @@ private void ClearAllButton_Click(object sender, RoutedEventArgs e)
682686
{
683687

684688
}
689+
690+
private void AddDialog_Loaded(object sender, RoutedEventArgs e)
691+
{
692+
AddDialogFrame.Navigate(typeof(AddItem), new SuppressNavigationTransitionInfo());
693+
}
694+
695+
private void NameDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
696+
{
697+
inputForRename = null;
698+
}
699+
700+
private async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
701+
{
702+
703+
if (Interaction.page.Name == "GenericItemView")
704+
{
705+
propertiesFrame.Navigate(typeof(Properties), (GenericFileBrowser.data.SelectedItem as ListedItem).FilePath, new SuppressNavigationTransitionInfo());
706+
}
707+
else if (Interaction.page.Name == "PhotoAlbumViewer")
708+
{
709+
propertiesFrame.Navigate(typeof(Properties), (PhotoAlbum.gv.SelectedItem as ListedItem).FilePath, new SuppressNavigationTransitionInfo());
710+
}
711+
await PropertiesDialog.ShowAsync();
712+
713+
}
685714
}
686715
}

Files UWP/Properties.xaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<Page
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:local="using:Files"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:Custom="using:Microsoft.Toolkit.Uwp.UI.Controls"
8+
x:Class="Files.Properties"
9+
mc:Ignorable="d"
10+
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
11+
12+
<Grid>
13+
<Grid.RowDefinitions>
14+
<RowDefinition Height="15*"/>
15+
<RowDefinition Height="85*"/>
16+
</Grid.RowDefinitions>
17+
18+
<Custom:TabView Background="White" CanCloseTabs="False" TabWidthBehavior="Equal" Grid.Row="0">
19+
<Custom:TabViewItem Background="White" Header="Info">
20+
<Custom:TabViewItem.Icon>
21+
<FontIcon Glyph="&#xE946;"/>
22+
</Custom:TabViewItem.Icon>
23+
</Custom:TabViewItem>
24+
<Custom:TabViewItem Background="White" Header="Details">
25+
<Custom:TabViewItem.Icon>
26+
<FontIcon Glyph="&#xEA37;"/>
27+
</Custom:TabViewItem.Icon>
28+
</Custom:TabViewItem>
29+
<Custom:TabViewItem Background="White" Visibility="Collapsed" Header="Security">
30+
<Custom:TabViewItem.Icon>
31+
<FontIcon Glyph="&#xE8A6;"/>
32+
</Custom:TabViewItem.Icon>
33+
</Custom:TabViewItem>
34+
</Custom:TabView>
35+
36+
<Grid Grid.Row="1" >
37+
<Frame Name="PropertiesTabContentFrame"/>
38+
</Grid>
39+
40+
</Grid>
41+
</Page>

Files UWP/Properties.xaml.cs

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Runtime.InteropServices.WindowsRuntime;
6+
using Windows.Foundation;
7+
using Windows.Foundation.Collections;
8+
using Windows.UI.Xaml;
9+
using Windows.UI.Xaml.Controls;
10+
using Windows.UI.Xaml.Controls.Primitives;
11+
using Windows.UI.Xaml.Data;
12+
using Windows.UI.Xaml.Input;
13+
using Windows.UI.Xaml.Media;
14+
using Windows.UI.Xaml.Navigation;
15+
16+
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
17+
18+
namespace Files
19+
{
20+
/// <summary>
21+
/// An empty page that can be used on its own or navigated to within a Frame.
22+
/// </summary>
23+
public sealed partial class Properties : Page
24+
{
25+
public Properties()
26+
{
27+
this.InitializeComponent();
28+
}
29+
30+
private void OK_Button_Click(object sender, RoutedEventArgs e)
31+
{
32+
33+
}
34+
35+
private void Cancel_Button_Click(object sender, RoutedEventArgs e)
36+
{
37+
38+
}
39+
40+
private void Apply_Button_Click(object sender, RoutedEventArgs e)
41+
{
42+
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)