Skip to content

Commit 612bd78

Browse files
committed
Ensure Copied/Cut Content Properly Flushes to Clipboard
1 parent 228b462 commit 612bd78

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
101101
CurrentInstance.BackButton.IsEnabled = CurrentInstance.accessibleContentFrame.CanGoBack;
102102
CurrentInstance.ForwardButton.IsEnabled = CurrentInstance.accessibleContentFrame.CanGoForward;
103103
CurrentInstance.RefreshButton.IsEnabled = true;
104+
Clipboard_ContentChanged(null, null);
104105
instanceViewModel.AlwaysPresentCommands.isEnabled = true;
105106
var parameters = (string)eventArgs.Parameter;
106107
instanceViewModel.CancelLoadAndClearFiles();
@@ -151,15 +152,6 @@ protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
151152
data.Columns[0].GetCellContent(dataGridRow).Opacity = 1;
152153
}
153154
}
154-
155-
if (Clipboard.GetContent().Contains(StandardDataFormats.StorageItems))
156-
{
157-
App.PS.isEnabled = true;
158-
}
159-
else
160-
{
161-
App.PS.isEnabled = false;
162-
}
163155
}
164156

165157

Files UWP/Interacts/Interaction.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public static T FindParent<T>(DependencyObject child) where T : DependencyObject
308308
}
309309
return parent;
310310
}
311-
311+
312312
public async void OpenItem_Click(object sender, RoutedEventArgs e)
313313
{
314314
if (typeof(PageType) == typeof(GenericFileBrowser))
@@ -664,6 +664,7 @@ public async void CutItem_Click(object sender, RoutedEventArgs e)
664664
IEnumerable<IStorageItem> EnumerableOfItems = items;
665665
dataPackage.SetStorageItems(EnumerableOfItems);
666666
Clipboard.SetContent(dataPackage);
667+
Clipboard.Flush();
667668
}
668669
public string CopySourcePath;
669670
public async void CopyItem_ClickAsync(object sender, RoutedEventArgs e)
@@ -717,6 +718,7 @@ public async void CopyItem_ClickAsync(object sender, RoutedEventArgs e)
717718
IEnumerable<IStorageItem> EnumerableOfItems = items;
718719
dataPackage.SetStorageItems(EnumerableOfItems);
719720
Clipboard.SetContent(dataPackage);
721+
Clipboard.Flush();
720722

721723
}
722724

0 commit comments

Comments
 (0)