Skip to content

Commit 1267d32

Browse files
committed
Add Empty File Placeholders
1 parent 2e677d9 commit 1267d32

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

Filesystem/ItemViewModel.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public class ItemViewModel
4040
static string gotFolPath;
4141
static string gotFolType;
4242
static Visibility gotFileImgVis;
43+
static Visibility gotEmptyImgVis;
4344
static Visibility gotFolImg;
4445
static StorageItemThumbnail gotFileImg;
4546
public static ObservableCollection<Classic_ListedFolderItem> ChildrenList;
@@ -225,6 +226,7 @@ public async void MemoryFriendlyGetItemsAsync(string path, CancellationToken tok
225226
gotFolType = "Folder";
226227
gotFolImg = Visibility.Visible;
227228
gotFileImgVis = Visibility.Collapsed;
229+
gotEmptyImgVis = Visibility.Collapsed;
228230

229231

230232
if (pageName == "ClassicModePage")
@@ -233,7 +235,7 @@ public async void MemoryFriendlyGetItemsAsync(string path, CancellationToken tok
233235
}
234236
else
235237
{
236-
FilesAndFolders.Add(new ListedItem() { ItemIndex = FilesAndFolders.Count, FileImg = null, FileIconVis = gotFileImgVis, FolderImg = gotFolImg, FileName = gotFolName, FileDate = gotFolDate, FileExtension = gotFolType, FilePath = gotFolPath });
238+
FilesAndFolders.Add(new ListedItem() { EmptyImgVis = gotEmptyImgVis, ItemIndex = FilesAndFolders.Count, FileImg = null, FileIconVis = gotFileImgVis, FolderImg = gotFolImg, FileName = gotFolName, FileDate = gotFolDate, FileExtension = gotFolType, FilePath = gotFolPath });
237239
}
238240
}
239241
index += step;
@@ -291,8 +293,13 @@ public async void MemoryFriendlyGetItemsAsync(string path, CancellationToken tok
291293
BitmapImage icon = new BitmapImage();
292294
if (gotFileImg != null)
293295
{
296+
gotEmptyImgVis = Visibility.Collapsed;
294297
icon.SetSource(gotFileImg.CloneStream());
295298
}
299+
else
300+
{
301+
gotEmptyImgVis = Visibility.Visible;
302+
}
296303
gotFileImgVis = Visibility.Visible;
297304

298305
if (pageName == "ClassicModePage")
@@ -301,7 +308,7 @@ public async void MemoryFriendlyGetItemsAsync(string path, CancellationToken tok
301308
}
302309
else
303310
{
304-
FilesAndFolders.Add(new ListedItem() { FileImg = icon, FileIconVis = gotFileImgVis, FolderImg = gotFolImg, FileName = gotName, FileDate = gotDate, FileExtension = gotType, FilePath = gotPath });
311+
FilesAndFolders.Add(new ListedItem() { EmptyImgVis = gotEmptyImgVis, FileImg = icon, FileIconVis = gotFileImgVis, FolderImg = gotFolImg, FileName = gotName, FileDate = gotDate, FileExtension = gotType, FilePath = gotPath });
305312
}
306313
}
307314
index += step;

Filesystem/ListedItem.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class ListedItem
77
{
88
public Visibility FolderImg { get; set; }
99
public Visibility FileIconVis { get; set; }
10+
public Visibility EmptyImgVis { get; set; }
1011
public BitmapImage FileImg { get; set; }
1112
public string FileName { get; set; }
1213
public string FileDate { get; set; }

GenericFileBrowser.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
<DataTemplate>
175175
<Grid Margin="15, 0, 0, 0">
176176
<FontIcon Visibility="{Binding FolderImg}" Glyph="&#xE8D5;" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/>
177+
<FontIcon Visibility="{Binding EmptyImgVis}" Glyph="&#xE7C3;" FontFamily="Segoe MDL2 Assets"/>
177178
<Image Visibility="{Binding FileIconVis}" Height="20" Width="20" Source="{Binding FileImg}" Stretch="UniformToFill" />
178179
</Grid>
179180
</DataTemplate>

PhotoAlbum.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
<GridView.Resources>
322322
<MenuFlyout x:Name="RightClickContextMenu" x:Key="RightClickFlyout">
323323
<MenuFlyout.Items>
324-
<MenuFlyoutItem Text="Open" Name="OpenItem">
324+
<MenuFlyoutItem Text="Open With..." Name="OpenItem">
325325
<MenuFlyoutItem.Icon>
326326
<FontIcon Glyph="&#xE7AC;"/>
327327
</MenuFlyoutItem.Icon>
@@ -382,6 +382,12 @@
382382
<FontIcon FontSize="92" Glyph="&#xE8D5;" FontFamily="Segoe MDL2 Assets" Foreground="#ffe793"/>
383383
</Grid>
384384
</Grid>
385+
<Grid Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Visibility="{Binding EmptyImgVis}">
386+
387+
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
388+
<FontIcon FontSize="92" Glyph="&#xE7C3;" FontFamily="Segoe MDL2 Assets"/>
389+
</Grid>
390+
</Grid>
385391
<TextBlock Grid.Row="1" VerticalAlignment="Top" Text="{Binding FileName}" TextWrapping="Wrap" TextAlignment="Center"/>
386392
</Grid>
387393

0 commit comments

Comments
 (0)