File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 21
21
SecondaryButtonText =" {x:Bind ViewModel.SecondaryButtonText, Mode=OneWay}"
22
22
Style =" {StaticResource DefaultContentDialogStyle}"
23
23
mc : Ignorable =" d" >
24
- <i : Interaction .Behaviors>
25
- <!-- No need to specify CommandParameter - `e` is passed by default -->
26
- <icore : EventTriggerBehavior EventName =" Loaded" >
27
- <icore : InvokeCommandAction Command =" {x:Bind ViewModel.LoadedCommand, Mode=OneWay}" />
28
- </icore : EventTriggerBehavior >
29
- </i : Interaction .Behaviors>
30
24
31
25
<ContentDialog .Resources>
32
26
<ResourceDictionary >
68
62
x : Load =" {x:Bind ViewModel.PermanentlyDeleteLoad, Mode=OneWay}"
69
63
Content =" Permanently delete"
70
64
IsChecked =" {x:Bind ViewModel.PermanentlyDelete, Mode=TwoWay}"
71
- IsEnabled =" {x:Bind ViewModel.PermanentlyDeleteEnabled, Mode=OneWay} " />
65
+ IsEnabled =" False " />
72
66
73
67
<Grid >
74
68
<ListView
75
69
x : Name =" DetailsGrid"
76
70
Grid.Row=" 1"
77
71
MaxHeight =" 200"
72
+ IsEnabled =" False"
78
73
IsItemClickEnabled =" False"
79
74
ItemsSource =" {x:Bind ViewModel.Items}"
80
75
SelectionMode =" {x:Bind ViewModel.ItemsSelectionMode, Mode=OneWay}" >
213
208
x : Uid =" ConflictingItemsDialogItemOptionReplaceExisting"
214
209
Command =" {Binding ReplaceExistingCommand}"
215
210
Text =" Replace" />
216
- <MenuFlyoutItem
217
- Command =" {Binding SkipCommand}"
218
- Text =" {helpers:ResourceString Name=Skip}" />
211
+ <MenuFlyoutItem Command =" {Binding SkipCommand}" Text =" {helpers:ResourceString Name=Skip}" />
219
212
</MenuFlyout >
220
213
</muxc : SplitButton .Flyout>
221
214
</muxc : SplitButton >
Original file line number Diff line number Diff line change 3
3
using Microsoft . Toolkit . Uwp . UI ;
4
4
using System . Collections . Generic ;
5
5
using System . Linq ;
6
+ using Windows . UI . Xaml ;
6
7
using Windows . UI . Xaml . Controls ;
7
8
8
9
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
@@ -25,6 +26,24 @@ public FilesystemOperationDialog(FilesystemOperationDialogViewModel viewModel)
25
26
26
27
ViewModel = viewModel ;
27
28
ViewModel . View = this ;
29
+ ViewModel . LoadedCommand . Execute ( null ) ;
30
+ }
31
+
32
+ protected override void OnApplyTemplate ( )
33
+ {
34
+ base . OnApplyTemplate ( ) ;
35
+ var primaryButton = this . FindDescendant ( "PrimaryButton" ) as Button ;
36
+ if ( primaryButton != null )
37
+ {
38
+ primaryButton . GotFocus += PrimaryButton_GotFocus ;
39
+ }
40
+ }
41
+
42
+ private void PrimaryButton_GotFocus ( object sender , RoutedEventArgs e )
43
+ {
44
+ ( sender as Button ) . GotFocus -= PrimaryButton_GotFocus ;
45
+ chkPermanentlyDelete . IsEnabled = ViewModel . PermanentlyDeleteEnabled ;
46
+ DetailsGrid . IsEnabled = true ;
28
47
}
29
48
30
49
private void MenuFlyoutItem_Click ( object sender , Windows . UI . Xaml . RoutedEventArgs e )
You can’t perform that action at this time.
0 commit comments