Skip to content

Commit dc69440

Browse files
authored
v0.7.4 release (#518)
1 parent ef91932 commit dc69440

File tree

10 files changed

+352
-41
lines changed

10 files changed

+352
-41
lines changed

Files.Package/Files.Package.wapproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<AppxBundlePlatforms>x86|x64|arm|arm64</AppxBundlePlatforms>
5555
<DisableXbfLineInfo>False</DisableXbfLineInfo>
5656
<GenerateTestArtifacts>True</GenerateTestArtifacts>
57-
<UapAppxPackageBuildMode>StoreAndSideload</UapAppxPackageBuildMode>
57+
<UapAppxPackageBuildMode>StoreUpload</UapAppxPackageBuildMode>
5858
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>
5959
<EntryPointProjectUniqueName>..\Files\Files.csproj</EntryPointProjectUniqueName>
6060
</PropertyGroup>

Files.Package/Package.appxmanifest

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" xmlns:desktop4="http://schemas.microsoft.com/appx/manifest/desktop/windows10/4" xmlns:desktop="http://schemas.microsoft.com/appx/manifest/desktop/windows10" xmlns:uap5="http://schemas.microsoft.com/appx/manifest/uap/windows10/5" IgnorableNamespaces="uap uap5 mp rescap desktop4 desktop">
3-
<Identity Name="FilesUWP" Publisher="CN=Luke Blevins" Version="0.7.4.0" />
3+
<Identity Name="49306atecsolution.FilesUWP" Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" Version="0.7.4.0" />
44
<Properties>
55
<DisplayName>Files UWP - Preview</DisplayName>
6-
<PublisherDisplayName>FilesUWP</PublisherDisplayName>
6+
<PublisherDisplayName>Yair A</PublisherDisplayName>
77
<Logo>Assets\StoreLogo.png</Logo>
88
</Properties>
99
<Dependencies>

Files/BaseLayout.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public List<ListedItem> SelectedItems
5252
{
5353
return _SelectedItems;
5454
}
55-
set
55+
internal set
5656
{
5757
if (value != _SelectedItems)
5858
{
@@ -77,7 +77,7 @@ public ListedItem SelectedItem
7777
{
7878
return _SelectedItem;
7979
}
80-
set
80+
internal set
8181
{
8282
if (value != _SelectedItem)
8383
{

Files/Files.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@
217217
<DependentUpon>GenericFileBrowser.xaml</DependentUpon>
218218
</Compile>
219219
<Compile Include="View Models\InteractionViewModel.cs" />
220+
<Compile Include="View Models\SelectedItemPropertiesViewModel.cs" />
220221
<Compile Include="Views\InstanceTabsView.xaml.cs">
221222
<DependentUpon>InstanceTabsView.xaml</DependentUpon>
222223
</Compile>

Files/Interacts/Interaction.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -471,9 +471,34 @@ public async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
471471

472472
public async void ShowFolderPropertiesButton_Click(object sender, RoutedEventArgs e)
473473
{
474-
App.propertiesDialog.propertiesFrame.Tag = App.propertiesDialog;
475-
App.propertiesDialog.propertiesFrame.Navigate(typeof(Properties), App.CurrentInstance.ViewModel.currentFolder, new SuppressNavigationTransitionInfo());
476-
await App.propertiesDialog.ShowAsync(ContentDialogPlacement.Popup);
474+
if (ApiInformation.IsApiContractPresent("Windows.Foundation.UniversalApiContract", 8))
475+
{
476+
AppWindow appWindow = await AppWindow.TryCreateAsync();
477+
Frame frame = new Frame();
478+
frame.Navigate(typeof(Properties), null, new SuppressNavigationTransitionInfo());
479+
WindowManagementPreview.SetPreferredMinSize(appWindow, new Size(400, 475));
480+
appWindow.RequestSize(new Size(400, 475));
481+
appWindow.Title = "Properties";
482+
483+
ElementCompositionPreview.SetAppWindowContent(appWindow, frame);
484+
AppWindows.Add(frame.UIContext, appWindow);
485+
486+
appWindow.Closed += delegate
487+
{
488+
Interaction.AppWindows.Remove(frame.UIContext);
489+
frame.Content = null;
490+
appWindow = null;
491+
};
492+
493+
await appWindow.TryShowAsync();
494+
}
495+
else
496+
{
497+
498+
App.propertiesDialog.propertiesFrame.Tag = App.propertiesDialog;
499+
App.propertiesDialog.propertiesFrame.Navigate(typeof(Properties), App.CurrentInstance.ViewModel.currentFolder, new SuppressNavigationTransitionInfo());
500+
await App.propertiesDialog.ShowAsync(ContentDialogPlacement.Popup);
501+
}
477502
}
478503

479504
private async void Manager_DataRequested(DataTransferManager sender, DataRequestedEventArgs args)

Files/Properties.xaml

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<RowDefinition Height="*"/>
1717
<RowDefinition Height="Auto"/>
1818
</Grid.RowDefinitions>
19-
<StackPanel Padding="14" Spacing="14" Grid.Row="0" Orientation="Horizontal">
19+
<StackPanel Padding="22,14" Spacing="14" Grid.Row="0" Orientation="Horizontal">
2020

2121
<Grid
2222
x:Name="Icon"
@@ -32,21 +32,22 @@
3232
FontSize="36"
3333
Foreground="#ffe793"
3434
Glyph="&#xE8D5;"
35-
Visibility="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FolderImg}" />
35+
x:Name="FolderGlyphIcon"
36+
x:Load="{x:Bind itemProperties.LoadFolderGlyph,Mode=OneWay}" />
3637
<FontIcon
3738
HorizontalAlignment="Stretch"
3839
VerticalAlignment="Stretch"
3940
FontFamily="Segoe MDL2 Assets"
4041
FontSize="36"
4142
x:Name="EmptyImageIcon"
4243
Glyph="&#xE7C3;"
43-
Visibility="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.EmptyImgVis}" />
44+
x:Load="{x:Bind itemProperties.LoadUnknownTypeGlyph,Mode=OneWay}" />
4445
<Image
4546
x:Name="itemIcon"
4647
HorizontalAlignment="Stretch"
4748
VerticalAlignment="Stretch"
48-
Loading="itemIcon_Loading"
49-
Visibility="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileIconVis}" />
49+
x:Load="{x:Bind itemProperties.LoadFileIcon,Mode=OneWay}"
50+
Source="{x:Bind itemProperties.FileIconSource,Mode=OneWay}"/>
5051
</Grid>
5152
<TextBox
5253
x:Name="itemFileName"
@@ -56,7 +57,7 @@
5657
VerticalAlignment="Center"
5758
BorderThickness="1"
5859
IsReadOnly="True"
59-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileName}" Width="285" />
60+
Text="{x:Bind itemProperties.ItemName,Mode=OneWay}" Width="300" />
6061
</StackPanel>
6162
<StackPanel Padding="14,0" Grid.Row="1">
6263
<MenuFlyoutSeparator Margin="-14,0" HorizontalAlignment="Stretch" />
@@ -67,10 +68,10 @@
6768
</Grid.ColumnDefinitions>
6869
<TextBlock x:Uid="PropertiesItemType" Text="Item type:" />
6970
<TextBlock
70-
x:Name="itemType"
71+
x:Name="itemTypeValue"
7172
Grid.Column="1"
7273
IsTextSelectionEnabled="True"
73-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileType}" />
74+
Text="{x:Bind itemProperties.ItemType,Mode=OneWay}" />
7475
</Grid>
7576
<Grid Padding="0,4">
7677
<Grid.ColumnDefinitions>
@@ -79,10 +80,10 @@
7980
</Grid.ColumnDefinitions>
8081
<TextBlock x:Uid="PropertiesItemPath" Text="Path:" />
8182
<TextBlock
82-
x:Name="itemPath"
83+
x:Name="itemPathValue"
8384
Grid.Column="2"
8485
IsTextSelectionEnabled="True"
85-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FilePath}"
86+
Text="{x:Bind itemProperties.ItemPath,Mode=OneWay}"
8687
TextWrapping="Wrap" />
8788
</Grid>
8889
<Grid Padding="0,4">
@@ -92,10 +93,10 @@
9293
</Grid.ColumnDefinitions>
9394
<TextBlock x:Uid="PropertiesItemSize" Text="Size:" />
9495
<TextBlock
95-
x:Name="itemSize"
96+
x:Name="itemSizeValue"
9697
Grid.Column="3"
9798
IsTextSelectionEnabled="True"
98-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileSize}" />
99+
Text="{x:Bind itemProperties.ItemSize,Mode=OneWay}" />
99100
</Grid>
100101
<MenuFlyoutSeparator Margin="-14,0" />
101102
<Grid Padding="0,4">
@@ -105,10 +106,10 @@
105106
</Grid.ColumnDefinitions>
106107
<TextBlock x:Uid="PropertiesCreated" Text="Created:" />
107108
<TextBlock
108-
x:Name="itemCreatedTimestamp"
109+
x:Name="itemCreatedTimestampValue"
109110
Grid.Column="4"
110111
IsTextSelectionEnabled="True"
111-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileDate}" />
112+
Text="{x:Bind itemProperties.ItemCreatedTimestamp,Mode=OneWay}" />
112113
</Grid>
113114
<Grid Padding="0,4">
114115
<Grid.ColumnDefinitions>
@@ -117,10 +118,10 @@
117118
</Grid.ColumnDefinitions>
118119
<TextBlock x:Uid="PropertiesModified" Text="Modified:" />
119120
<TextBlock
120-
x:Name="itemModifiedTimestamp"
121+
x:Name="itemModifiedTimestampValue"
121122
Grid.Column="5"
122123
IsTextSelectionEnabled="True"
123-
Text="{x:Bind local:App.CurrentInstance.ContentPage.SelectedItem.FileDate}" />
124+
Text="{x:Bind itemProperties.ItemModifiedTimestamp,Mode=OneWay}" />
124125
</Grid>
125126

126127
</StackPanel>

Files/Properties.xaml.cs

Lines changed: 105 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
using Files.Interacts;
1+
using Files.Filesystem;
2+
using Files.Interacts;
3+
using GalaSoft.MvvmLight;
24
using System;
35
using Windows.Foundation.Metadata;
46
using Windows.Storage;
57
using Windows.UI.WindowManagement;
68
using Windows.UI.Xaml.Controls;
9+
using Windows.UI.Xaml.Media;
710
using Windows.UI.Xaml.Media.Imaging;
811

912
namespace Files
@@ -12,7 +15,7 @@ namespace Files
1215
public sealed partial class Properties : Page
1316
{
1417
public AppWindow propWindow;
15-
18+
public ItemPropertiesViewModel itemProperties { get; } = new ItemPropertiesViewModel();
1619
public Properties()
1720
{
1821
this.InitializeComponent();
@@ -26,34 +29,55 @@ public Properties()
2629
}
2730
}
2831

29-
private void Properties_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
32+
private async void Properties_Loaded(object sender, Windows.UI.Xaml.RoutedEventArgs e)
3033
{
3134
// Collect AppWindow-specific info
3235
propWindow = Interaction.AppWindows[this.UIContext];
33-
}
34-
35-
private async void itemIcon_Loading(Windows.UI.Xaml.FrameworkElement sender, object args)
36-
{
37-
if (App.CurrentInstance.ContentPage.SelectedItem != null)
36+
if (App.CurrentInstance.ContentPage.IsItemSelected)
3837
{
38+
var selectedItem = App.CurrentInstance.ContentPage.SelectedItem;
39+
IStorageItem selectedStorageItem;
40+
try
41+
{
42+
selectedStorageItem = await StorageFolder.GetFolderFromPathAsync(selectedItem.FilePath);
43+
}
44+
catch (Exception)
45+
{
46+
// Not a folder, so attempt to get as StorageFile
47+
selectedStorageItem = await StorageFile.GetFileFromPathAsync(selectedItem.FilePath);
48+
}
49+
itemProperties.ItemName = selectedItem.FileName;
50+
itemProperties.ItemType = selectedItem.FileType;
51+
itemProperties.ItemPath = selectedItem.FilePath;
52+
itemProperties.ItemSize = selectedItem.FileSize;
53+
itemProperties.LoadFileIcon = selectedItem.FileIconVis == Windows.UI.Xaml.Visibility.Visible ? true : false;
54+
itemProperties.LoadFolderGlyph = selectedItem.FolderImg == Windows.UI.Xaml.Visibility.Visible ? true : false;
55+
itemProperties.LoadUnknownTypeGlyph = selectedItem.EmptyImgVis == Windows.UI.Xaml.Visibility.Visible ? true : false;
56+
itemProperties.ItemModifiedTimestamp = selectedItem.FileDate;
57+
itemProperties.ItemCreatedTimestamp = ListedItem.GetFriendlyDate(selectedStorageItem.DateCreated);
58+
3959
if (App.CurrentInstance.ContentPage.SelectedItem.FolderImg != Windows.UI.Xaml.Visibility.Visible)
4060
{
4161
var thumbnail = await (await StorageFile.GetFileFromPathAsync(App.CurrentInstance.ContentPage.SelectedItem.FilePath)).GetThumbnailAsync(Windows.Storage.FileProperties.ThumbnailMode.SingleItem, 40, Windows.Storage.FileProperties.ThumbnailOptions.ResizeThumbnail);
4262
var bitmap = new BitmapImage();
4363
await bitmap.SetSourceAsync(thumbnail);
44-
itemIcon.Source = bitmap;
45-
}
46-
else
47-
{
48-
EmptyImageIcon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
64+
itemProperties.FileIconSource = bitmap;
4965
}
5066
}
5167
else
5268
{
53-
EmptyImageIcon.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
69+
var parentDirectory = App.CurrentInstance.ViewModel.currentFolder;
70+
var parentDirectoryStorageItem = await StorageFolder.GetFolderFromPathAsync(parentDirectory.FilePath);
71+
itemProperties.ItemName = parentDirectory.FileName;
72+
itemProperties.ItemType = parentDirectory.FileType;
73+
itemProperties.ItemPath = parentDirectory.FilePath;
74+
itemProperties.ItemSize = parentDirectory.FileSize;
75+
itemProperties.LoadFileIcon = false;
76+
itemProperties.LoadFolderGlyph = true;
77+
itemProperties.LoadUnknownTypeGlyph = false;
78+
itemProperties.ItemModifiedTimestamp = parentDirectory.FileDate;
79+
itemProperties.ItemCreatedTimestamp = ListedItem.GetFriendlyDate(parentDirectoryStorageItem.DateCreated);
5480
}
55-
56-
5781
}
5882

5983
private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
@@ -64,4 +88,69 @@ private async void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e
6488
}
6589
}
6690
}
91+
92+
public class ItemPropertiesViewModel : ViewModelBase
93+
{
94+
private string _ItemName;
95+
private string _ItemType;
96+
private string _ItemPath;
97+
private string _ItemSize;
98+
private string _ItemCreatedTimestamp;
99+
private string _ItemModifiedTimestamp;
100+
private ImageSource _FileIconSource;
101+
private bool _LoadFolderGlyph;
102+
private bool _LoadUnknownTypeGlyph;
103+
private bool _LoadFileIcon;
104+
105+
public string ItemName
106+
{
107+
get => _ItemName;
108+
set => Set(ref _ItemName, value);
109+
}
110+
public string ItemType
111+
{
112+
get => _ItemType;
113+
set => Set(ref _ItemType, value);
114+
}
115+
public string ItemPath
116+
{
117+
get => _ItemPath;
118+
set => Set(ref _ItemPath, value);
119+
}
120+
public string ItemSize
121+
{
122+
get => _ItemSize;
123+
set => Set(ref _ItemSize, value);
124+
}
125+
public string ItemCreatedTimestamp
126+
{
127+
get => _ItemCreatedTimestamp;
128+
set => Set(ref _ItemCreatedTimestamp, value);
129+
}
130+
public string ItemModifiedTimestamp
131+
{
132+
get => _ItemModifiedTimestamp;
133+
set => Set(ref _ItemModifiedTimestamp, value);
134+
}
135+
public ImageSource FileIconSource
136+
{
137+
get => _FileIconSource;
138+
set => Set(ref _FileIconSource, value);
139+
}
140+
public bool LoadFolderGlyph
141+
{
142+
get => _LoadFolderGlyph;
143+
set => Set(ref _LoadFolderGlyph, value);
144+
}
145+
public bool LoadUnknownTypeGlyph
146+
{
147+
get => _LoadUnknownTypeGlyph;
148+
set => Set(ref _LoadUnknownTypeGlyph, value);
149+
}
150+
public bool LoadFileIcon
151+
{
152+
get => _LoadFileIcon;
153+
set => Set(ref _LoadFileIcon, value);
154+
}
155+
}
67156
}

Files/View Models/ItemViewModel.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,20 @@ public async void RapidAddItemsToCollectionAsync(string path)
625625
try
626626
{
627627
_rootFolder = await StorageFolder.GetFolderFromPathAsync(path);
628+
_rootFolderItem = new ListedItem(_rootFolder.FolderRelativeId)
629+
{
630+
ItemPropertiesInitialized = true,
631+
FileName = _rootFolder.Name,
632+
FileDateReal = (await _rootFolder.GetBasicPropertiesAsync()).DateModified,
633+
FileType = "Folder", //TODO: Take a look at folder.DisplayType
634+
FolderImg = Visibility.Visible,
635+
FileImg = null,
636+
FileIconVis = Visibility.Collapsed,
637+
FilePath = _rootFolder.Path,
638+
EmptyImgVis = Visibility.Collapsed,
639+
FileSize = null,
640+
FileSizeBytes = 0
641+
};
628642
}
629643
catch (UnauthorizedAccessException)
630644
{

0 commit comments

Comments
 (0)