Skip to content

Commit cfedfba

Browse files
Added Properties data Populated in the UI
1 parent e92c606 commit cfedfba

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

Files UWP/ProHome.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ public async void ShowPropertiesButton_Click(object sender, RoutedEventArgs e)
910910
{
911911
if (this.accessibleContentFrame.SourcePageType == typeof(GenericFileBrowser))
912912
{
913+
propertiesFrame.Tag = PropertiesDialog;
913914
propertiesFrame.Navigate(typeof(Properties), (ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).data.SelectedItems, new SuppressNavigationTransitionInfo());
914915
}
915916
else if (this.accessibleContentFrame.SourcePageType == typeof(PhotoAlbum))

Files UWP/Properties.xaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,37 +22,37 @@
2222
<ColumnDefinition Width="Auto"/>
2323
<ColumnDefinition Width="*"/>
2424
</Grid.ColumnDefinitions>
25-
<Image Margin="15,15" Grid.Column="0" Width="45" Height="45" Name="itemIcon" />
26-
<TextBox CornerRadius="2" BorderThickness="1" Padding="10,4" Name="itemFileName" PlaceholderText="Item Name" VerticalAlignment="Center" Grid.Column="1" Margin="0,0,15,0" />
25+
<Image Margin="15,15" Grid.Column="0" Width="45" Height="45" Name="itemIcon" Source="{x:Bind Item.FileImg,Mode=OneWay}" />
26+
<TextBox CornerRadius="2" BorderThickness="1" Padding="10,4" Name="itemFileName" Text="{x:Bind Item.FileName,Mode=OneWay}" PlaceholderText="Item Name" VerticalAlignment="Center" Grid.Column="1" Margin="0,0,15,0" />
2727
</Grid>
2828
<MenuFlyoutSeparator HorizontalAlignment="Stretch" Margin="-10,0,-10,0"/>
2929
<StackPanel Padding="0,10" Spacing="24" Orientation="Horizontal">
3030
<TextBlock Text="Item type:"/>
31-
<TextBlock Name="itemType" />
31+
<TextBlock Name="itemType" Text="{x:Bind Item.FileType,Mode=OneWay}" />
3232
</StackPanel>
3333
<StackPanel Padding="0,10" Spacing="24" Orientation="Horizontal">
3434
<TextBlock Text="Path:"/>
35-
<TextBlock Name="itemPath" />
35+
<TextBlock Name="itemPath" Text="{x:Bind Item.FilePath,Mode=OneWay}" />
3636
</StackPanel>
3737
<StackPanel Padding="0,10" Spacing="24" Orientation="Horizontal">
3838
<TextBlock Text="Item size:"/>
39-
<TextBlock Name="itemSize" />
39+
<TextBlock Name="itemSize" Text="{x:Bind Item.FileSize,Mode=OneWay}" />
4040
</StackPanel>
4141
<MenuFlyoutSeparator Margin="-10,0,-10,0"/>
4242
<StackPanel Padding="0,10" Spacing="24" Orientation="Horizontal">
4343
<TextBlock Text="Created:"/>
44-
<TextBlock Name="itemCreatedTimestamp" />
44+
<TextBlock Name="itemCreatedTimestamp" Text="{x:Bind Item.FileDate,Mode=OneWay}" />
4545
</StackPanel>
4646
<StackPanel Padding="0,10" Spacing="24" Orientation="Horizontal">
4747
<TextBlock Text="Modified:"/>
48-
<TextBlock Name="itemModifiedTimestamp" />
48+
<TextBlock Name="itemModifiedTimestamp" Text="{x:Bind Item.FileDate,Mode=OneWay}"/>
4949
</StackPanel>
5050
</StackPanel>
5151

5252
<StackPanel Spacing="5" Padding="0,10" Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
5353
<Button Content="OK" Foreground="White" Background="#FF0078D7" CornerRadius="2" Width="128" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="Button_Click"/>
54-
<Button Content="Apply" CornerRadius="2" Width="128" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
55-
<Button Content="Cancel" CornerRadius="2" Width="128" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
54+
<Button Content="Apply" CornerRadius="2" Width="128" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="Button_Click"/>
55+
<Button Content="Cancel" CornerRadius="2" Width="128" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Click="Button_Click"/>
5656
</StackPanel>
5757
</Grid>
5858
</Page>

Files UWP/Properties.xaml.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using Files.Filesystem;
22
using Files.Interacts;
33
using System;
4+
using System.Collections;
45
using System.Collections.Generic;
6+
using System.Collections.ObjectModel;
57
using System.IO;
68
using System.Linq;
79
using System.Runtime.InteropServices.WindowsRuntime;
@@ -20,14 +22,24 @@ namespace Files
2022

2123
public sealed partial class Properties : Page
2224
{
25+
ListedItem Item { get; set; }
26+
ContentDialog PropertiesDialog { get; set; }
2327
public Properties()
2428
{
2529
this.InitializeComponent();
2630
}
2731

32+
protected override void OnNavigatedTo(NavigationEventArgs e)
33+
{
34+
var result = e.Parameter as IEnumerable;
35+
IList<ListedItem> listedItems = result.OfType<ListedItem>().ToList();
36+
Item = listedItems[0];
37+
PropertiesDialog = Frame.Tag as ContentDialog;
38+
base.OnNavigatedTo(e);
39+
}
2840
private void OK_Button_Click(object sender, RoutedEventArgs e)
2941
{
30-
42+
3143
}
3244

3345
private void Apply_Button_Click(object sender, RoutedEventArgs e)
@@ -37,7 +49,7 @@ private void Apply_Button_Click(object sender, RoutedEventArgs e)
3749

3850
private void Button_Click(object sender, RoutedEventArgs e)
3951
{
40-
52+
PropertiesDialog?.Hide();
4153
}
4254
}
4355
}

0 commit comments

Comments
 (0)