@@ -10,189 +10,6 @@ namespace Files.Navigation
10
10
{
11
11
public class NavigationActions
12
12
{
13
- public static void Back_Click ( object sender , RoutedEventArgs e )
14
- {
15
- App . ViewModel . CancelLoadAndClearFiles ( ) ;
16
-
17
- //if (History.HistoryList.Count > 1)
18
- //{
19
-
20
- App . ViewModel . TextState . isVisible = Visibility . Collapsed ;
21
-
22
- //History.AddToForwardList(History.HistoryList[History.HistoryList.Count - 1]);
23
- //History.HistoryList.RemoveAt(History.HistoryList.Count - 1);
24
-
25
- //App.ViewModel.CancelLoadAndClearFiles();
26
- if ( ProHome . accessibleContentFrame . CanGoBack )
27
- {
28
-
29
- //// If the item we are navigating back to is a specific library, accomodate this.
30
- //PageStackEntry pse = ProHome.accessibleContentFrame.BackStack[0];
31
- // try
32
- // {
33
- // Debug.WriteLine(pse.Parameter.ToString());
34
- // }
35
- // catch
36
- // {
37
-
38
- // }
39
- //if (ProHome.accessibleContentFrame.BackStack[(ProHome.accessibleContentFrame.BackStackDepth - 1)].Parameter.ToString() == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))
40
- //{
41
- // App.PathText.Text = "Desktop";
42
- // ProHome.locationsList.SelectedIndex = 1;
43
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DesktopPath, new SuppressNavigationTransitionInfo());
44
- //}
45
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
46
- //{
47
- // App.PathText.Text = "Documents";
48
- // ProHome.locationsList.SelectedIndex = 3;
49
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo());
50
- //}
51
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads"))
52
- //{
53
- // App.PathText.Text = "Downloads";
54
- // ProHome.locationsList.SelectedIndex = 2;
55
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo());
56
- //}
57
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures))
58
- //{
59
- // ProHome.locationsList.SelectedIndex = 4;
60
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.PicturesPath, new SuppressNavigationTransitionInfo());
61
- // App.PathText.Text = "Pictures";
62
- //}
63
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic))
64
- //{
65
- // App.PathText.Text = "Music";
66
- // ProHome.locationsList.SelectedIndex = 5;
67
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.MusicPath, new SuppressNavigationTransitionInfo());
68
- //}
69
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive"))
70
- //{
71
- // App.PathText.Text = "OneDrive";
72
- // ProHome.drivesList.SelectedIndex = 1;
73
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo());
74
- //}
75
- //else if ((History.HistoryList[History.HistoryList.Count - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos))
76
- //{
77
- // App.PathText.Text = "Videos";
78
- // ProHome.locationsList.SelectedIndex = 6;
79
- // //ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.VideosPath, new SuppressNavigationTransitionInfo());
80
- //}
81
- //else if (ProHome.accessibleContentFrame.BackStack[(ProHome.accessibleContentFrame.BackStackDepth - 1)].Parameter == null)
82
- //{
83
- // if (ProHome.accessibleContentFrame.BackStack[(ProHome.accessibleContentFrame.BackStackDepth - 1)].SourcePageType == typeof(YourHome))
84
- // {
85
- // App.PathText.Text = "This PC";
86
- // }
87
-
88
- //}
89
- //else
90
- //{
91
-
92
- // if ((History.HistoryList[History.HistoryList.Count - 1]).Contains("C:"))
93
- // {
94
- // ProHome.drivesList.SelectedIndex = 0;
95
- // }
96
- // App.PathText.Text = (History.HistoryList[History.HistoryList.Count - 1]);
97
- // //App.ViewModel.AddItemsToCollectionAsync(History.HistoryList[History.HistoryList.Count - 1], GenericFileBrowser.GFBPageName); // To take into account the correct index without interference from the folder being navigated to
98
-
99
- //}
100
-
101
- ProHome . accessibleContentFrame . GoBack ( ) ;
102
- }
103
-
104
- //if (History.ForwardList.Count == 0)
105
- //{
106
- // App.ViewModel.FS.isEnabled = false;
107
- //}
108
- //else if (History.ForwardList.Count > 0)
109
- //{
110
- // App.ViewModel.FS.isEnabled = true;
111
- //}
112
-
113
- //}
114
-
115
- }
116
-
117
- public static void Forward_Click ( object sender , RoutedEventArgs e )
118
- {
119
-
120
- App . ViewModel . CancelLoadAndClearFiles ( ) ;
121
-
122
- //if (History.ForwardList.Count() > 0)
123
- //{
124
- // App.ViewModel.TextState.isVisible = Visibility.Collapsed;
125
- // App.ViewModel.CancelLoadAndClearFiles();
126
-
127
- // if ((History.ForwardList[History.ForwardList.Count() - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory))
128
- // {
129
- // App.PathText.Text = "Desktop";
130
- // ProHome.locationsList.SelectedIndex = 1;
131
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DesktopPath, new SuppressNavigationTransitionInfo());
132
- // }
133
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
134
- // {
135
- // App.PathText.Text = "Documents";
136
- // ProHome.locationsList.SelectedIndex = 3;
137
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DocumentsPath, new SuppressNavigationTransitionInfo());
138
- // }
139
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\Downloads"))
140
- // {
141
- // App.PathText.Text = "Downloads";
142
- // ProHome.locationsList.SelectedIndex = 2;
143
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.DownloadsPath, new SuppressNavigationTransitionInfo());
144
- // }
145
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyPictures))
146
- // {
147
- // ProHome.locationsList.SelectedIndex = 4;
148
- // ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), YourHome.PicturesPath, new SuppressNavigationTransitionInfo());
149
- // App.PathText.Text = "Pictures";
150
- // }
151
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyMusic))
152
- // {
153
- // App.PathText.Text = "Music";
154
- // ProHome.locationsList.SelectedIndex = 5;
155
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.MusicPath, new SuppressNavigationTransitionInfo());
156
- // }
157
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == (Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) + @"\OneDrive"))
158
- // {
159
- // App.PathText.Text = "OneDrive";
160
- // ProHome.drivesList.SelectedIndex = 1;
161
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.OneDrivePath, new SuppressNavigationTransitionInfo());
162
- // }
163
- // else if ((History.ForwardList[History.ForwardList.Count() - 1]) == Environment.GetFolderPath(Environment.SpecialFolder.MyVideos))
164
- // {
165
- // App.PathText.Text = "Videos";
166
- // ProHome.locationsList.SelectedIndex = 6;
167
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), YourHome.VideosPath, new SuppressNavigationTransitionInfo());
168
- // }
169
- // else
170
- // {
171
- // //Debug.WriteLine("Debug: " + ("Removable Drive (" + History.ForwardList[History.ForwardList.Count() - 1].Split('\\')[0] + "\\)"));
172
- // if (!History.ForwardList[History.ForwardList.Count - 1].Split('\\')[0].Contains("C:\\"))
173
- // {
174
- // ProHome.drivesList.SelectedIndex = 0;
175
- // }
176
- // App.PathText.Text = (History.ForwardList[History.ForwardList.Count - 1]);
177
- // ProHome.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), History.ForwardList[History.ForwardList.Count - 1], new SuppressNavigationTransitionInfo());
178
- // }
179
-
180
-
181
-
182
- // History.ForwardList.RemoveAt(History.ForwardList.Count() - 1);
183
-
184
- // if (History.ForwardList.Count == 0)
185
- // {
186
- // App.ViewModel.FS.isEnabled = false;
187
- // }
188
- // else if (History.ForwardList.Count > 0)
189
- // {
190
- // App.ViewModel.FS.isEnabled = true;
191
- // }
192
-
193
- //}
194
- }
195
-
196
13
public async static void Refresh_Click ( object sender , RoutedEventArgs e )
197
14
{
198
15
await Windows . ApplicationModel . Core . CoreApplication . MainView . CoreWindow . Dispatcher . RunAsync ( CoreDispatcherPriority . Normal , ( ) =>
0 commit comments