Skip to content

Commit 228b462

Browse files
committed
Fix Duplicated Refresh Bug
1 parent a111058 commit 228b462

File tree

4 files changed

+6
-14
lines changed

4 files changed

+6
-14
lines changed

ExecutableLauncher/Program.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ private static void Main(string[] args)
1313
var executable = (string)ApplicationData.Current.LocalSettings.Values["Application"];
1414
Process.Start(executable);
1515
}
16-
catch (Exception e)
16+
catch (System.ComponentModel.Win32Exception e)
1717
{
18+
Console.WriteLine("While most executables work now, UWP restrictions still prevent the execution of this file");
1819
Console.WriteLine(e.Message);
20+
Console.WriteLine(e.StackTrace);
1921
Console.ReadLine();
2022
}
2123
}

Files UWP/Filesystem/ItemViewModel.cs

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,16 +215,8 @@ public async void AddItemsToCollectionAsync(string path, Page currentPage)
215215

216216
_cancellationTokenSource = new CancellationTokenSource();
217217

218-
if (typeof(PageType) == typeof(GenericFileBrowser))
219-
{
220-
(currentPage as GenericFileBrowser).emptyTextGFB.Visibility = Visibility.Collapsed;
221-
_filesAndFolders.Clear();
222-
}
223-
else if (typeof(PageType) == typeof(PhotoAlbum))
224-
{
225-
(currentPage as PhotoAlbum).EmptyTextPA.Visibility = Visibility.Collapsed;
226-
_filesAndFolders.Clear();
227-
}
218+
GetCurrentSelectedTabInstance<ProHome>().TextState.isVisible = Visibility.Collapsed;
219+
_filesAndFolders.Clear();
228220
Universal.path = path;
229221

230222
Stopwatch stopwatch = new Stopwatch();

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
105105
var parameters = (string)eventArgs.Parameter;
106106
instanceViewModel.CancelLoadAndClearFiles();
107107
instanceViewModel.Universal.path = parameters;
108-
CurrentInstance.RefreshButton.Click += NavigationActions.Refresh_Click;
109108
CurrentInstance.AddItemButton.Click += AddItem_Click;
110109
instanceViewModel.AddItemsToCollectionAsync(instanceViewModel.Universal.path, this);
111110
TextState_PropertyChanged(null, null);

Files UWP/ProHome.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public ProHome()
8989
PopulateNavViewWithExternalDrives();
9090
BackButton.Click += NavigationActions.Back_Click;
9191
ForwardButton.Click += NavigationActions.Forward_Click;
92+
RefreshButton.Click += NavigationActions.Refresh_Click;
9293
ribbonShadow.Receivers.Add(RibbonShadowSurface);
9394
Ribbon.Translation += new System.Numerics.Vector3(0, 0, 4);
9495

@@ -806,14 +807,12 @@ await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatch
806807
{
807808
var ContentOwnedViewModelInstance = (ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).instanceViewModel;
808809
ContentOwnedViewModelInstance.CancelLoadAndClearFiles();
809-
(ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).emptyTextGFB.Visibility = Visibility.Collapsed;
810810
ContentOwnedViewModelInstance.AddItemsToCollectionAsync(ContentOwnedViewModelInstance.Universal.path, (ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as GenericFileBrowser).GFBPageName);
811811
}
812812
else if ((ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as PhotoAlbum) != null)
813813
{
814814
var ContentOwnedViewModelInstance = (ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as PhotoAlbum).instanceViewModel;
815815
ContentOwnedViewModelInstance.CancelLoadAndClearFiles();
816-
(ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as PhotoAlbum).EmptyTextPA.Visibility = Visibility.Collapsed;
817816
ContentOwnedViewModelInstance.AddItemsToCollectionAsync(ContentOwnedViewModelInstance.Universal.path, (ItemViewModel<ProHome>.GetCurrentSelectedTabInstance<ProHome>().accessibleContentFrame.Content as PhotoAlbum).PAPageName);
818817
}
819818

0 commit comments

Comments
 (0)