Skip to content

Commit f650599

Browse files
committed
ListViewItems Will Select Upon Navigation
1 parent c7de446 commit f650599

File tree

8 files changed

+105
-431
lines changed

8 files changed

+105
-431
lines changed

Files UWP/FilesUWP.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
<Compile Include="Navigation\BackState.cs" />
127127
<Compile Include="Navigation\ForwardState.cs" />
128128
<Compile Include="Navigation\NavigationActions.cs" />
129-
<Compile Include="Navigation\PhotoAlbumNavActions.cs" />
130129
<Compile Include="Navigation\UniversalPath.cs" />
131130
<Compile Include="PhotoAlbum.xaml.cs">
132131
<DependentUpon>PhotoAlbum.xaml</DependentUpon>

Files UWP/Interacts/Interaction.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,12 @@ public static async void List_ItemClick(object sender, DoubleTappedRoutedEventAr
267267
// }
268268
//}
269269

270-
App.ViewModel.AddItemsToCollectionAsync(clickedOnItem.FilePath, PhotoAlbum.PAPageName);
270+
ProHome.accessibleContentFrame.Navigate(typeof(PhotoAlbum), clickedOnItem.FilePath, new SuppressNavigationTransitionInfo());
271271
}
272272
}
273273
else if (clickedOnItem.FileType == "Application")
274274
{
275-
//Interaction.message = new MessageDialog("We noticed you’re trying to run an Application file. This type of file may be a security risk to your device, and is not supported by the Universal Windows Platform. If you're not sure what this means, check out the Microsoft Store for a large selection of secure apps, games, and more.");
276-
//Interaction.message.Title = "Unsupported Functionality";
277-
//Interaction.message.Commands.Add(new UICommand("Continue...", new UICommandInvokedHandler(Interaction.CommandInvokedHandler)));
278-
//Interaction.message.Commands.Add(new UICommand("Cancel"));
279-
//await Interaction.message.ShowAsync();
280275
await LaunchExe(clickedOnItem.FilePath);
281-
282276
}
283277
else
284278
{

Files UWP/Navigation/NavigationActions.cs

Lines changed: 0 additions & 183 deletions
Original file line numberDiff line numberDiff line change
@@ -10,189 +10,6 @@ namespace Files.Navigation
1010
{
1111
public class NavigationActions
1212
{
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-
19613
public async static void Refresh_Click(object sender, RoutedEventArgs e)
19714
{
19815
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>

0 commit comments

Comments
 (0)