11using Files . Enums ;
2+ using GalaSoft . MvvmLight ;
23using System ;
3- using System . ComponentModel ;
44using Windows . Storage ;
55using Windows . UI . Xaml . Media . Imaging ;
66
77namespace Files . Filesystem
88{
9- public class ListedItem : INotifyPropertyChanged
9+ public class ListedItem : ObservableObject
1010 {
1111 public StorageItemTypes PrimaryItemAttribute { get ; set ; }
1212 public bool ItemPropertiesInitialized { get ; set ; } = false ;
@@ -17,52 +17,36 @@ public class ListedItem : INotifyPropertyChanged
1717
1818 public bool LoadFileIcon
1919 {
20- get
21- {
22- return _LoadFileIcon ;
23- }
24- set
25- {
26- if ( _LoadFileIcon != value )
27- {
28- _LoadFileIcon = value ;
29- NotifyPropertyChanged ( "LoadFileIcon" ) ;
30- }
31- }
20+ get => _LoadFileIcon ;
21+ set => Set ( ref _LoadFileIcon , value ) ;
3222 }
3323
3424 private bool _LoadUnknownTypeGlyph ;
3525
3626 public bool LoadUnknownTypeGlyph
3727 {
38- get
39- {
40- return _LoadUnknownTypeGlyph ;
41- }
42- set
43- {
44- if ( _LoadUnknownTypeGlyph != value )
45- {
46- _LoadUnknownTypeGlyph = value ;
47- NotifyPropertyChanged ( "LoadUnknownTypeGlyph" ) ;
48- }
49- }
28+ get => _LoadUnknownTypeGlyph ;
29+ set => Set ( ref _LoadUnknownTypeGlyph , value ) ;
30+ }
31+
32+ private CloudDriveSyncStatusUI _SyncStatusUI ;
33+
34+ public CloudDriveSyncStatusUI SyncStatusUI
35+ {
36+ get => _SyncStatusUI ;
37+ set => Set ( ref _SyncStatusUI , value ) ;
5038 }
5139
5240 private BitmapImage _FileImage ;
5341
5442 public BitmapImage FileImage
5543 {
56- get
57- {
58- return _FileImage ;
59- }
44+ get => _FileImage ;
6045 set
6146 {
62- if ( _FileImage != value && value != null )
47+ if ( value != null )
6348 {
64- _FileImage = value ;
65- NotifyPropertyChanged ( "FileImage" ) ;
49+ Set ( ref _FileImage , value ) ;
6650 }
6751 }
6852 }
@@ -73,16 +57,12 @@ public BitmapImage FileImage
7357
7458 public string ItemType
7559 {
76- get
77- {
78- return _ItemType ;
79- }
60+ get => _ItemType ;
8061 set
8162 {
82- if ( _ItemType != value && value != null )
63+ if ( value != null )
8364 {
84- _ItemType = value ;
85- NotifyPropertyChanged ( "ItemType" ) ;
65+ Set ( ref _ItemType , value ) ;
8666 }
8767 }
8868 }
@@ -97,7 +77,7 @@ public string ItemType
9777
9878 public DateTimeOffset ItemDateModifiedReal
9979 {
100- get { return _itemDateModifiedReal ; }
80+ get => _itemDateModifiedReal ;
10181 set
10282 {
10383 ItemDateModified = GetFriendlyDate ( value ) ;
@@ -107,21 +87,14 @@ public DateTimeOffset ItemDateModifiedReal
10787
10888 private DateTimeOffset _itemDateModifiedReal ;
10989
110- public event PropertyChangedEventHandler PropertyChanged ;
111-
112- private void NotifyPropertyChanged ( string info )
113- {
114- PropertyChanged ? . Invoke ( this , new PropertyChangedEventArgs ( info ) ) ;
115- }
116-
11790 public ListedItem ( string folderRelativeId )
11891 {
11992 FolderRelativeId = folderRelativeId ;
12093 }
12194
12295 public static string GetFriendlyDate ( DateTimeOffset d )
12396 {
124- Windows . Storage . ApplicationDataContainer localSettings = Windows . Storage . ApplicationData . Current . LocalSettings ;
97+ ApplicationDataContainer localSettings = ApplicationData . Current . LocalSettings ;
12598 var elapsed = DateTimeOffset . Now - d ;
12699
127100 string returnformat = Enum . Parse < TimeStyle > ( localSettings . Values [ LocalSettings . DateTimeFormat ] . ToString ( ) ) == TimeStyle . Application ? "D" : "g" ;
0 commit comments