|
13 | 13 | using Windows.UI.ViewManagement; |
14 | 14 | using Windows.UI.Xaml; |
15 | 15 | using Windows.UI.Xaml.Controls; |
| 16 | +using Windows.UI.Xaml.Media.Animation; |
16 | 17 | using Windows.UI.Xaml.Navigation; |
17 | 18 |
|
18 | 19 | namespace Files |
@@ -73,20 +74,21 @@ public GenericFileBrowser() |
73 | 74 |
|
74 | 75 | private async void AddItem_ClickAsync(object sender, RoutedEventArgs e) |
75 | 76 | { |
76 | | - var CurrentView = ApplicationView.GetForCurrentView(); |
77 | | - CoreApplicationView NewView = CoreApplication.CreateNewView(); |
78 | | - |
79 | | - await NewView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => |
80 | | - { |
81 | | - var newWindow = Window.Current; |
82 | | - var newAppView = ApplicationView.GetForCurrentView(); |
83 | | - Frame frame = new Frame(); |
84 | | - frame.Navigate(typeof(AddItem), null); |
85 | | - Window.Current.Content = frame; |
86 | | - Window.Current.Activate(); |
87 | | - await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newAppView.Id, ViewSizePreference.Default, CurrentView.Id, ViewSizePreference.Default); |
88 | | - |
89 | | - }); |
| 77 | + await AddDialog.ShowAsync(); |
| 78 | + //var CurrentView = ApplicationView.GetForCurrentView(); |
| 79 | + //CoreApplicationView NewView = CoreApplication.CreateNewView(); |
| 80 | + |
| 81 | + //await NewView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => |
| 82 | + //{ |
| 83 | + // var newWindow = Window.Current; |
| 84 | + // var newAppView = ApplicationView.GetForCurrentView(); |
| 85 | + // Frame frame = new Frame(); |
| 86 | + // frame.Navigate(typeof(AddItem), null); |
| 87 | + // Window.Current.Content = frame; |
| 88 | + // Window.Current.Activate(); |
| 89 | + // await ApplicationViewSwitcher.TryShowAsStandaloneAsync(newAppView.Id, ViewSizePreference.Default, CurrentView.Id, ViewSizePreference.Default); |
| 90 | + |
| 91 | + //}); |
90 | 92 | } |
91 | 93 |
|
92 | 94 | private void Clipboard_ContentChanged(object sender, object e) |
@@ -208,7 +210,10 @@ private async void AllView_CellEditEnded(object sender, DataGridCellEditEndedEve |
208 | 210 | } |
209 | 211 | } |
210 | 212 |
|
211 | | - |
| 213 | + private void ContentDialog_Loaded(object sender, RoutedEventArgs e) |
| 214 | + { |
| 215 | + AddDialogFrame.Navigate(typeof(AddItem), new SuppressNavigationTransitionInfo()); |
| 216 | + } |
212 | 217 | } |
213 | 218 |
|
214 | 219 | public class EmptyFolderTextState : INotifyPropertyChanged |
|
0 commit comments