@@ -24,9 +24,7 @@ namespace Files.Interacts
24
24
{
25
25
public class Interaction
26
26
{
27
-
28
- private static PasteState ps = new PasteState ( ) ;
29
- public static PasteState PS { get { return ps ; } }
27
+ public static PasteState PS { get ; } = new PasteState ( ) ;
30
28
31
29
public static Page page ;
32
30
public Interaction ( Page p )
@@ -39,24 +37,24 @@ public Interaction(Page p)
39
37
// Double-tap event for DataGrid
40
38
public static async void List_ItemClick ( object sender , DoubleTappedRoutedEventArgs e )
41
39
{
40
+
42
41
if ( page . Name == "GenericItemView" )
43
42
{
44
-
45
43
var index = GenericFileBrowser . data . SelectedIndex ;
46
-
47
44
if ( index > - 1 )
48
45
{
49
46
var clickedOnItem = App . ViewModel . FilesAndFolders [ index ] ;
50
-
51
47
if ( clickedOnItem . FileExtension == "Folder" )
52
48
{
49
+ App . ViewModel . Universal . path = clickedOnItem . FilePath ;
50
+ App . PathText . Text = clickedOnItem . FilePath ;
53
51
App . ViewModel . TextState . isVisible = Visibility . Collapsed ;
54
52
History . ForwardList . Clear ( ) ;
55
53
App . ViewModel . FS . isEnabled = false ;
56
54
App . ViewModel . FilesAndFolders . Clear ( ) ;
57
55
if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) )
58
56
{
59
- App . ViewModel . Universal . path = "Desktop" ;
57
+ App . PathText . Text = "Desktop" ;
60
58
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
61
59
{
62
60
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DesktopIC" )
@@ -70,7 +68,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
70
68
}
71
69
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) )
72
70
{
73
- App . ViewModel . Universal . path = "Documents" ;
71
+ App . PathText . Text = "Documents" ;
74
72
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
75
73
{
76
74
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DocumentsIC" )
@@ -84,7 +82,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
84
82
}
85
83
else if ( clickedOnItem . FilePath == ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\Downloads" ) )
86
84
{
87
- App . ViewModel . Universal . path = "Downloads" ;
85
+ App . PathText . Text = "Downloads" ;
88
86
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
89
87
{
90
88
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DownloadsIC" )
@@ -108,11 +106,11 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
108
106
}
109
107
MainPage . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , YourHome . PicturesPath , new SuppressNavigationTransitionInfo ( ) ) ;
110
108
MainPage . accessibleAutoSuggestBox . PlaceholderText = "Search Pictures" ;
111
- App . ViewModel . Universal . path = "Pictures" ;
109
+ App . PathText . Text = "Pictures" ;
112
110
}
113
111
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyMusic ) )
114
112
{
115
- App . ViewModel . Universal . path = "Music" ;
113
+ App . PathText . Text = "Music" ;
116
114
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
117
115
{
118
116
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "MusicIC" )
@@ -126,7 +124,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
126
124
}
127
125
else if ( clickedOnItem . FilePath == ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\OneDrive" ) )
128
126
{
129
- App . ViewModel . Universal . path = "OneDrive" ;
127
+ App . PathText . Text = "OneDrive" ;
130
128
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
131
129
{
132
130
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "OneD_IC" )
@@ -140,7 +138,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
140
138
}
141
139
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) )
142
140
{
143
- App . ViewModel . Universal . path = "Videos" ;
141
+ App . PathText . Text = "Videos" ;
144
142
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
145
143
{
146
144
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "VideosIC" )
@@ -198,16 +196,17 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
198
196
if ( index > - 1 )
199
197
{
200
198
var clickedOnItem = App . ViewModel . FilesAndFolders [ index ] ;
201
-
202
199
if ( clickedOnItem . FileExtension == "Folder" )
203
200
{
201
+ App . ViewModel . Universal . path = clickedOnItem . FilePath ;
202
+ App . PathText . Text = clickedOnItem . FilePath ;
204
203
App . ViewModel . TextState . isVisible = Visibility . Collapsed ;
205
204
History . ForwardList . Clear ( ) ;
206
205
App . ViewModel . FS . isEnabled = false ;
207
206
App . ViewModel . FilesAndFolders . Clear ( ) ;
208
207
if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . DesktopDirectory ) )
209
208
{
210
- App . ViewModel . Universal . path = "Desktop" ;
209
+ App . PathText . Text = "Desktop" ;
211
210
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
212
211
{
213
212
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DesktopIC" )
@@ -221,7 +220,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
221
220
}
222
221
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyDocuments ) )
223
222
{
224
- App . ViewModel . Universal . path = "Documents" ;
223
+ App . PathText . Text = "Documents" ;
225
224
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
226
225
{
227
226
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DocumentsIC" )
@@ -235,7 +234,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
235
234
}
236
235
else if ( clickedOnItem . FilePath == ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\Downloads" ) )
237
236
{
238
- App . ViewModel . Universal . path = "Downloads" ;
237
+ App . PathText . Text = "Downloads" ;
239
238
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
240
239
{
241
240
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "DownloadsIC" )
@@ -259,11 +258,11 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
259
258
}
260
259
MainPage . accessibleContentFrame . Navigate ( typeof ( PhotoAlbum ) , YourHome . PicturesPath , new SuppressNavigationTransitionInfo ( ) ) ;
261
260
MainPage . accessibleAutoSuggestBox . PlaceholderText = "Search Pictures" ;
262
- App . ViewModel . Universal . path = "Pictures" ;
261
+ App . PathText . Text = "Pictures" ;
263
262
}
264
263
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyMusic ) )
265
264
{
266
- App . ViewModel . Universal . path = "Music" ;
265
+ App . PathText . Text = "Music" ;
267
266
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
268
267
{
269
268
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "MusicIC" )
@@ -277,7 +276,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
277
276
}
278
277
else if ( clickedOnItem . FilePath == ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) + @"\OneDrive" ) )
279
278
{
280
- App . ViewModel . Universal . path = "OneDrive" ;
279
+ App . PathText . Text = "OneDrive" ;
281
280
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
282
281
{
283
282
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "OneD_IC" )
@@ -291,7 +290,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
291
290
}
292
291
else if ( clickedOnItem . FilePath == Environment . GetFolderPath ( Environment . SpecialFolder . MyVideos ) )
293
292
{
294
- App . ViewModel . Universal . path = "Videos" ;
293
+ App . PathText . Text = "Videos" ;
295
294
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
296
295
{
297
296
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "VideosIC" )
@@ -305,7 +304,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
305
304
}
306
305
else
307
306
{
308
- App . ViewModel . Universal . path = clickedOnItem . FilePath ;
307
+ App . PathText . Text = clickedOnItem . FilePath ;
309
308
foreach ( Microsoft . UI . Xaml . Controls . NavigationViewItemBase NavItemChoice in MainPage . nv . MenuItems )
310
309
{
311
310
if ( NavItemChoice is Microsoft . UI . Xaml . Controls . NavigationViewItem && NavItemChoice . Name . ToString ( ) == "LocD_IC" )
@@ -314,7 +313,7 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
314
313
break ;
315
314
}
316
315
}
317
- App . ViewModel . MemoryFriendlyGetItemsAsync ( App . ViewModel . Universal . path , PhotoAlbum . PAPageName ) ;
316
+ App . ViewModel . MemoryFriendlyGetItemsAsync ( clickedOnItem . FilePath , PhotoAlbum . PAPageName ) ;
318
317
}
319
318
}
320
319
else if ( clickedOnItem . FileExtension == "Executable" )
0 commit comments