-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fixed delete dialog primary button focus issue #7882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2a12ee7
Fixes delete dialog primary button focus issue.
puppetsw 69f3a49
cleanup
puppetsw c79199c
Fix for memory leak
puppetsw dd69326
Another attempt at fixing
puppetsw 0bd7b4a
Cleanup
puppetsw 3255221
Test
gave92 513884a
Merge branch 'main' into rev_button
gave92 ea6c817
Test 2
gave92 dcf08fb
Check if permanent delete checkbox is loaded
gave92 bfd3872
Reverted
puppetsw 7c179ea
Added missing using
puppetsw 7194caa
File cleanup from revert.
puppetsw 043a4b9
Remainder cleanup
puppetsw 8ccb9d0
Moved ItemSource setting back into loaded event.
puppetsw 11ea82b
Added unhook in loaded event.
puppetsw 03286c2
Fix focus not on button outside recycle bin
gave92 9b1e38b
Enable checkbox after primary button is focused
gave92 2815aa8
Set itemssource in xaml
gave92 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
using Microsoft.Toolkit.Uwp.UI; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238 | ||
|
@@ -25,6 +26,24 @@ public FilesystemOperationDialog(FilesystemOperationDialogViewModel viewModel) | |
|
||
ViewModel = viewModel; | ||
ViewModel.View = this; | ||
ViewModel.LoadedCommand.Execute(null); | ||
} | ||
|
||
protected override void OnApplyTemplate() | ||
{ | ||
base.OnApplyTemplate(); | ||
var primaryButton = this.FindDescendant("PrimaryButton") as Button; | ||
if (primaryButton != null) | ||
{ | ||
primaryButton.GotFocus += PrimaryButton_GotFocus; | ||
} | ||
} | ||
|
||
private void PrimaryButton_GotFocus(object sender, RoutedEventArgs e) | ||
{ | ||
(sender as Button).GotFocus -= PrimaryButton_GotFocus; | ||
chkPermanentlyDelete.IsEnabled = ViewModel.PermanentlyDeleteEnabled; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to add a null check around line 45: "if (chkPermanentDelete != null)..". |
||
DetailsGrid.IsEnabled = true; | ||
} | ||
|
||
private void MenuFlyoutItem_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.