Skip to content

Commit 91da481

Browse files
committed
Enable Card Presses for new UI
1 parent 85b350d commit 91da481

File tree

8 files changed

+229
-355
lines changed

8 files changed

+229
-355
lines changed

Files UWP/FilesUWP.csproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -227,28 +227,28 @@
227227
<Version>1.3.0</Version>
228228
</PackageReference>
229229
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
230-
<Version>6.1.9</Version>
230+
<Version>6.2.8</Version>
231231
</PackageReference>
232232
<PackageReference Include="Microsoft.Toolkit.Uwp">
233-
<Version>5.1.0</Version>
233+
<Version>5.1.1</Version>
234234
</PackageReference>
235235
<PackageReference Include="Microsoft.Toolkit.Uwp.DeveloperTools">
236-
<Version>5.1.0</Version>
236+
<Version>5.1.1</Version>
237237
</PackageReference>
238238
<PackageReference Include="Microsoft.Toolkit.Uwp.UI">
239-
<Version>5.1.0</Version>
239+
<Version>5.1.1</Version>
240240
</PackageReference>
241241
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Animations">
242-
<Version>5.1.0</Version>
242+
<Version>5.1.1</Version>
243243
</PackageReference>
244244
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
245-
<Version>5.1.0</Version>
245+
<Version>5.1.1</Version>
246246
</PackageReference>
247247
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls.DataGrid">
248248
<Version>5.1.0</Version>
249249
</PackageReference>
250250
<PackageReference Include="Microsoft.UI.Xaml">
251-
<Version>2.1.190218001-prerelease</Version>
251+
<Version>2.1.190405004</Version>
252252
</PackageReference>
253253
</ItemGroup>
254254
<ItemGroup>

Files UWP/GenericFileBrowser.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@
176176
</Page.ContextFlyout>
177177

178178
<Grid Name="RootGrid">
179+
<TextBlock Name="EmptyText" Visibility="{x:Bind local:App.ViewModel.TextState.isVisible, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" HorizontalAlignment="Center" Text="This folder is empty." TextWrapping="Wrap" VerticalAlignment="Top" Margin="0,125,0,0" Canvas.ZIndex="0"/>
179180
<controls:DataGrid AllowDrop="True" Drop="AllView_DropAsync" DragLeave="AllView_DragLeave" DragStarting="AllView_DragStarting" ContextRequested="AllView_ContextRequested" SelectionChanged="AllView_SelectionChanged" Margin="24,24,0,0" Grid.Row="3" CellEditEnded="AllView_CellEditEnded" FocusVisualPrimaryThickness="0" SelectionMode="Extended" IsDoubleTapEnabled="True" x:FieldModifier="public" x:Name="AllView" AutoGenerateColumns="False" CanDrag="True" DragOver="AllView_DragOver" IsRightTapEnabled="True" CanUserReorderColumns="False" IsReadOnly="True" ItemsSource="{x:Bind local:App.ViewModel.FilesAndFolders}" HorizontalAlignment="Left">
180181

181182
<controls:DataGrid.ColumnHeaderStyle>

Files UWP/GenericFileBrowser.xaml.cs

Lines changed: 1 addition & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -326,148 +326,7 @@ private void NameDialog_SecondaryButtonClick(ContentDialog sender, ContentDialog
326326

327327
private async void VisiblePath_TextChanged(object sender, KeyRoutedEventArgs e)
328328
{
329-
if (e.Key == VirtualKey.Enter)
330-
{
331-
var PathBox = (sender as TextBox);
332-
var CurrentInput = PathBox.Text;
333-
if (CurrentInput != App.ViewModel.Universal.path)
334-
{
335-
App.ViewModel.CancelLoadAndClearFiles();
336-
337-
if (CurrentInput == "Home" || CurrentInput == "home")
338-
{
339-
MainPage.accessibleContentFrame.Navigate(typeof(YourHome));
340-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Recents";
341-
}
342-
else if (CurrentInput == "Desktop" || CurrentInput == "desktop")
343-
{
344-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
345-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.DesktopPath);
346-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Desktop";
347-
App.PathText.Text = "Desktop";
348-
}
349-
else if (CurrentInput == "Documents" || CurrentInput == "documents")
350-
{
351-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
352-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.DocumentsPath);
353-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Documents";
354-
App.PathText.Text = "Documents";
355-
356-
}
357-
else if (CurrentInput == "Downloads" || CurrentInput == "downloads")
358-
{
359-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
360-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.DownloadsPath);
361-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Downloads";
362-
App.PathText.Text = "Downloads";
363-
364-
}
365-
else if (CurrentInput == "Pictures" || CurrentInput == "pictures")
366-
{
367-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
368-
MainPage.accessibleContentFrame.Navigate(typeof(PhotoAlbum), MainPage.PicturesPath);
369-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Pictures";
370-
App.PathText.Text = "Pictures";
371-
}
372-
else if (CurrentInput == "Music" || CurrentInput == "music")
373-
{
374-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
375-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.MusicPath);
376-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Music";
377-
App.PathText.Text = "Music";
378-
379-
}
380-
else if (CurrentInput == "Videos" || CurrentInput == "videos")
381-
{
382-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
383-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.VideosPath);
384-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search Videos";
385-
App.PathText.Text = "Videos";
386-
387-
}
388-
else if (CurrentInput == "OneDrive" || CurrentInput == "Onedrive" || CurrentInput == "onedrive")
389-
{
390-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
391-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), MainPage.OneDrivePath);
392-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search OneDrive";
393-
App.PathText.Text = "OneDrive";
394-
395-
}
396-
else
397-
{
398-
if (CurrentInput.Contains("."))
399-
{
400-
if (CurrentInput.Contains(".exe") || CurrentInput.Contains(".EXE"))
401-
{
402-
if (StorageFile.GetFileFromPathAsync(CurrentInput) != null)
403-
{
404-
await Interaction.LaunchExe(CurrentInput);
405-
PathBox.Text = App.ViewModel.Universal.path;
406-
}
407-
else
408-
{
409-
MessageDialog dialog = new MessageDialog("The path typed was not correct. Please try again.", "Invalid Path");
410-
await dialog.ShowAsync();
411-
}
412-
}
413-
else if (StorageFolder.GetFolderFromPathAsync(CurrentInput) != null)
414-
{
415-
await StorageFolder.GetFolderFromPathAsync(CurrentInput);
416-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
417-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), CurrentInput);
418-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search";
419-
}
420-
else
421-
{
422-
try
423-
{
424-
await StorageFile.GetFileFromPathAsync(CurrentInput);
425-
StorageFile file = await StorageFile.GetFileFromPathAsync(CurrentInput);
426-
var options = new LauncherOptions
427-
{
428-
DisplayApplicationPicker = false
429-
430-
};
431-
await Launcher.LaunchFileAsync(file, options);
432-
PathBox.Text = App.ViewModel.Universal.path;
433-
}
434-
catch (ArgumentException)
435-
{
436-
MessageDialog dialog = new MessageDialog("The path typed was not correct. Please try again.", "Invalid Path");
437-
await dialog.ShowAsync();
438-
}
439-
catch (FileNotFoundException)
440-
{
441-
MessageDialog dialog = new MessageDialog("The path typed was not correct. Please try again.", "Invalid Path");
442-
await dialog.ShowAsync();
443-
}
444-
}
445-
}
446-
else
447-
{
448-
try
449-
{
450-
await StorageFolder.GetFolderFromPathAsync(CurrentInput);
451-
App.ViewModel.TextState.isVisible = Visibility.Collapsed;
452-
MainPage.accessibleContentFrame.Navigate(typeof(GenericFileBrowser), CurrentInput);
453-
MainPage.accessibleAutoSuggestBox.PlaceholderText = "Search";
454-
}
455-
catch (ArgumentException)
456-
{
457-
MessageDialog dialog = new MessageDialog("The path typed was not correct. Please try again.", "Invalid Path");
458-
await dialog.ShowAsync();
459-
}
460-
catch (FileNotFoundException)
461-
{
462-
MessageDialog dialog = new MessageDialog("The path typed was not correct. Please try again.", "Invalid Path");
463-
await dialog.ShowAsync();
464-
}
465-
466-
}
467-
468-
}
469-
}
470-
}
329+
471330

472331
}
473332

0 commit comments

Comments
 (0)