@@ -19,11 +19,11 @@ public static DynamicDialog GetFor_PropertySaveErrorDialog()
19
19
{
20
20
DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
21
21
{
22
- TitleText = "PropertySaveErrorDialog/Title" . GetLocalizedResource ( ) ,
23
- SubtitleText = "PropertySaveErrorMessage/Text" . GetLocalizedResource ( ) , // We can use subtitle here as our content
24
- PrimaryButtonText = " Retry" . GetLocalizedResource ( ) ,
25
- SecondaryButtonText = "PropertySaveErrorDialog/SecondaryButtonText" . GetLocalizedResource ( ) ,
26
- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
22
+ TitleText = Strings . PropertySaveErrorDialog_Title . GetLocalizedResource ( ) ,
23
+ SubtitleText = Strings . PropertySaveErrorMessage_Text . GetLocalizedResource ( ) , // We can use subtitle here as our content
24
+ PrimaryButtonText = Strings . Retry . GetLocalizedResource ( ) ,
25
+ SecondaryButtonText = Strings . PropertySaveErrorDialog_SecondaryButtonText . GetLocalizedResource ( ) ,
26
+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
27
27
DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Secondary | DynamicDialogButtons . Cancel
28
28
} ) ;
29
29
return dialog ;
@@ -33,9 +33,9 @@ public static DynamicDialog GetFor_ConsentDialog()
33
33
{
34
34
DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
35
35
{
36
- TitleText = "WelcomeDialog/Title" . GetLocalizedResource ( ) ,
37
- SubtitleText = "WelcomeDialogTextBlock/Text" . GetLocalizedResource ( ) , // We can use subtitle here as our content
38
- PrimaryButtonText = "WelcomeDialog/PrimaryButtonText" . GetLocalizedResource ( ) ,
36
+ TitleText = Strings . WelcomeDialog_Title . GetLocalizedResource ( ) ,
37
+ SubtitleText = Strings . WelcomeDialogTextBlock_Text . GetLocalizedResource ( ) , // We can use subtitle here as our content
38
+ PrimaryButtonText = Strings . WelcomeDialog_PrimaryButtonText . GetLocalizedResource ( ) ,
39
39
PrimaryButtonAction = async ( vm , e ) => await Launcher . LaunchUriAsync ( new Uri ( "ms-settings:privacy-broadfilesystemaccess" ) ) ,
40
40
DynamicButtons = DynamicDialogButtons . Primary
41
41
} ) ;
@@ -46,10 +46,10 @@ public static DynamicDialog GetFor_ShortcutNotFound(string targetPath)
46
46
{
47
47
DynamicDialog dialog = new ( new DynamicDialogViewModel
48
48
{
49
- TitleText = " ShortcutCannotBeOpened" . GetLocalizedResource ( ) ,
50
- SubtitleText = string . Format ( " DeleteShortcutDescription" . GetLocalizedResource ( ) , targetPath ) ,
51
- PrimaryButtonText = " Delete" . GetLocalizedResource ( ) ,
52
- SecondaryButtonText = "No" . GetLocalizedResource ( ) ,
49
+ TitleText = Strings . ShortcutCannotBeOpened . GetLocalizedResource ( ) ,
50
+ SubtitleText = string . Format ( Strings . DeleteShortcutDescription . GetLocalizedResource ( ) , targetPath ) ,
51
+ PrimaryButtonText = Strings . Delete . GetLocalizedResource ( ) ,
52
+ SecondaryButtonText = Strings . No . GetLocalizedResource ( ) ,
53
53
DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Secondary
54
54
} ) ;
55
55
return dialog ;
@@ -60,12 +60,12 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
60
60
DynamicDialog ? dialog = null ;
61
61
TextBox inputText = new ( )
62
62
{
63
- PlaceholderText = " EnterAnItemName" . GetLocalizedResource ( )
63
+ PlaceholderText = Strings . EnterAnItemName . GetLocalizedResource ( )
64
64
} ;
65
65
66
66
TeachingTip warning = new ( )
67
67
{
68
- Title = "InvalidFilename/Text" . GetLocalizedResource ( ) ,
68
+ Title = Strings . InvalidFilename_Text . GetLocalizedResource ( ) ,
69
69
PreferredPlacement = TeachingTipPlacementMode . Bottom ,
70
70
DataContext = new CreateItemDialogViewModel ( ) ,
71
71
} ;
@@ -101,7 +101,7 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
101
101
102
102
dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
103
103
{
104
- TitleText = string . Format ( " CreateNewItemTitle" . GetLocalizedResource ( ) , itemType ) ,
104
+ TitleText = string . Format ( Strings . CreateNewItemTitle . GetLocalizedResource ( ) , itemType ) ,
105
105
SubtitleText = null ,
106
106
DisplayControl = new Grid ( )
107
107
{
@@ -115,8 +115,8 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
115
115
{
116
116
vm . HideDialog ( ) ; // Rename successful
117
117
} ,
118
- PrimaryButtonText = " Create" . GetLocalizedResource ( ) ,
119
- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
118
+ PrimaryButtonText = Strings . Create . GetLocalizedResource ( ) ,
119
+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
120
120
DynamicButtonsEnabled = DynamicDialogButtons . Cancel ,
121
121
DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Cancel
122
122
} ) ;
@@ -133,9 +133,9 @@ public static DynamicDialog GetFor_FileInUseDialog(List<Win32Process> lockingPro
133
133
{
134
134
DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
135
135
{
136
- TitleText = "FileInUseDialog/Title" . GetLocalizedResource ( ) ,
137
- SubtitleText = lockingProcess . IsEmpty ( ) ? "FileInUseDialog/Text" . GetLocalizedResource ( ) :
138
- string . Format ( "FileInUseByDialog/Text" . GetLocalizedResource ( ) , string . Join ( ", " , lockingProcess . Select ( x => $ "{ x . AppName ?? x . Name } (PID: { x . Pid } )") ) ) ,
136
+ TitleText = Strings . FileInUseDialog_Title . GetLocalizedResource ( ) ,
137
+ SubtitleText = lockingProcess . IsEmpty ( ) ? Strings . FileInUseDialog_Text . GetLocalizedResource ( ) :
138
+ string . Format ( Strings . FileInUseByDialog_Text . GetLocalizedResource ( ) , string . Join ( ", " , lockingProcess . Select ( x => $ "{ x . AppName ?? x . Name } (PID: { x . Pid } )") ) ) ,
139
139
PrimaryButtonText = "OK" ,
140
140
DynamicButtons = DynamicDialogButtons . Primary
141
141
} ) ;
@@ -149,17 +149,17 @@ public static DynamicDialog GetFor_CredentialEntryDialog(string path)
149
149
150
150
TextBox inputUsername = new ( )
151
151
{
152
- PlaceholderText = "CredentialDialogUserName/PlaceholderText" . GetLocalizedResource ( )
152
+ PlaceholderText = Strings . CredentialDialogUserName_PlaceholderText . GetLocalizedResource ( )
153
153
} ;
154
154
155
155
PasswordBox inputPassword = new ( )
156
156
{
157
- PlaceholderText = " Password" . GetLocalizedResource ( )
157
+ PlaceholderText = Strings . Password . GetLocalizedResource ( )
158
158
} ;
159
159
160
160
CheckBox saveCreds = new ( )
161
161
{
162
- Content = " NetworkAuthenticationSaveCheckbox" . GetLocalizedResource ( )
162
+ Content = Strings . NetworkAuthenticationSaveCheckbox . GetLocalizedResource ( )
163
163
} ;
164
164
165
165
inputUsername . TextChanged += ( textBox , args ) =>
@@ -188,10 +188,10 @@ public static DynamicDialog GetFor_CredentialEntryDialog(string path)
188
188
189
189
dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
190
190
{
191
- TitleText = " NetworkAuthenticationDialogTitle" . GetLocalizedResource ( ) ,
192
- PrimaryButtonText = "OK" . GetLocalizedResource ( ) ,
193
- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
194
- SubtitleText = string . Format ( " NetworkAuthenticationDialogMessage" . GetLocalizedResource ( ) , path . Substring ( 2 ) ) ,
191
+ TitleText = Strings . NetworkAuthenticationDialogTitle . GetLocalizedResource ( ) ,
192
+ PrimaryButtonText = Strings . OK . GetLocalizedResource ( ) ,
193
+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
194
+ SubtitleText = string . Format ( Strings . NetworkAuthenticationDialogMessage . GetLocalizedResource ( ) , path . Substring ( 2 ) ) ,
195
195
DisplayControl = new Grid ( )
196
196
{
197
197
MinWidth = 250d ,
@@ -228,9 +228,9 @@ public static DynamicDialog GetFor_GitCheckoutConflicts(string checkoutBranchNam
228
228
{
229
229
ItemsSource = new string [ ]
230
230
{
231
- string . Format ( " BringChanges" . GetLocalizedResource ( ) , checkoutBranchName ) ,
232
- string . Format ( " StashChanges" . GetLocalizedResource ( ) , headBranchName ) ,
233
- " DiscardChanges" . GetLocalizedResource ( )
231
+ string . Format ( Strings . BringChanges . GetLocalizedResource ( ) , checkoutBranchName ) ,
232
+ string . Format ( Strings . StashChanges . GetLocalizedResource ( ) , headBranchName ) ,
233
+ Strings . DiscardChanges . GetLocalizedResource ( )
234
234
} ,
235
235
SelectionMode = ListViewSelectionMode . Single
236
236
} ;
@@ -243,10 +243,10 @@ public static DynamicDialog GetFor_GitCheckoutConflicts(string checkoutBranchNam
243
243
244
244
dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
245
245
{
246
- TitleText = " SwitchBranch" . GetLocalizedResource ( ) ,
247
- PrimaryButtonText = " Switch" . GetLocalizedResource ( ) ,
248
- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
249
- SubtitleText = " UncommittedChanges" . GetLocalizedResource ( ) ,
246
+ TitleText = Strings . SwitchBranch . GetLocalizedResource ( ) ,
247
+ PrimaryButtonText = Strings . Switch . GetLocalizedResource ( ) ,
248
+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
249
+ SubtitleText = Strings . UncommittedChanges . GetLocalizedResource ( ) ,
250
250
DisplayControl = new Grid ( )
251
251
{
252
252
MinWidth = 250d ,
@@ -271,8 +271,8 @@ public static DynamicDialog GetFor_GitHubConnectionError()
271
271
DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
272
272
{
273
273
TitleText = "Error" . GetLocalizedResource ( ) ,
274
- SubtitleText = " CannotReachGitHubError" . GetLocalizedResource ( ) ,
275
- PrimaryButtonText = " Close" . GetLocalizedResource ( ) ,
274
+ SubtitleText = Strings . CannotReachGitHubError . GetLocalizedResource ( ) ,
275
+ PrimaryButtonText = Strings . Close . GetLocalizedResource ( ) ,
276
276
DynamicButtons = DynamicDialogButtons . Primary
277
277
} ) ;
278
278
return dialog ;
@@ -283,8 +283,8 @@ public static DynamicDialog GetFor_GitCannotInitializeqRepositoryHere()
283
283
return new DynamicDialog ( new DynamicDialogViewModel ( )
284
284
{
285
285
TitleText = "Error" . GetLocalizedResource ( ) ,
286
- SubtitleText = " CannotInitializeGitRepo" . GetLocalizedResource ( ) ,
287
- PrimaryButtonText = " Close" . GetLocalizedResource ( ) ,
286
+ SubtitleText = Strings . CannotInitializeGitRepo . GetLocalizedResource ( ) ,
287
+ PrimaryButtonText = Strings . Close . GetLocalizedResource ( ) ,
288
288
DynamicButtons = DynamicDialogButtons . Primary
289
289
} ) ;
290
290
}
@@ -294,10 +294,10 @@ public static DynamicDialog GetFor_DeleteGitBranchConfirmation(string branchName
294
294
DynamicDialog dialog = null ! ;
295
295
dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
296
296
{
297
- TitleText = " GitDeleteBranch" . GetLocalizedResource ( ) ,
298
- SubtitleText = string . Format ( " GitDeleteBranchSubtitle" . GetLocalizedResource ( ) , branchName ) ,
299
- PrimaryButtonText = "OK" . GetLocalizedResource ( ) ,
300
- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
297
+ TitleText = Strings . GitDeleteBranch . GetLocalizedResource ( ) ,
298
+ SubtitleText = string . Format ( Strings . GitDeleteBranchSubtitle . GetLocalizedResource ( ) , branchName ) ,
299
+ PrimaryButtonText = Strings . OK . GetLocalizedResource ( ) ,
300
+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
301
301
AdditionalData = true ,
302
302
CloseButtonAction = ( vm , e ) =>
303
303
{
@@ -314,10 +314,10 @@ public static DynamicDialog GetFor_RenameRequiresHigherPermissions(string path)
314
314
DynamicDialog dialog = null ! ;
315
315
dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
316
316
{
317
- TitleText = " ItemRenameFailed" . GetLocalizedResource ( ) ,
318
- SubtitleText = string . Format ( " HigherPermissionsRequired" . GetLocalizedResource ( ) , path ) ,
319
- PrimaryButtonText = "OK" . GetLocalizedResource ( ) ,
320
- SecondaryButtonText = " EditPermissions" . GetLocalizedResource ( ) ,
317
+ TitleText = Strings . ItemRenameFailed . GetLocalizedResource ( ) ,
318
+ SubtitleText = string . Format ( Strings . HigherPermissionsRequired . GetLocalizedResource ( ) , path ) ,
319
+ PrimaryButtonText = Strings . OK . GetLocalizedResource ( ) ,
320
+ SecondaryButtonText = Strings . EditPermissions . GetLocalizedResource ( ) ,
321
321
SecondaryButtonAction = ( vm , e ) =>
322
322
{
323
323
var context = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
@@ -424,5 +424,18 @@ await commands.OpenSettings.ExecuteAsync(
424
424
new SettingsNavigationParams ( ) { PageKind = SettingsPageKind . DevToolsPage }
425
425
) ;
426
426
}
427
+
428
+ public static async Task ShowFor_CannotCloneRepo ( string exception )
429
+ {
430
+ var dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
431
+ {
432
+ TitleText = "CannotCloneRepoTitle" . GetLocalizedResource ( ) ,
433
+ SubtitleText = exception ,
434
+ PrimaryButtonText = Strings . OK . GetLocalizedResource ( ) ,
435
+ DynamicButtons = DynamicDialogButtons . Primary
436
+ } ) ;
437
+
438
+ await dialog . TryShowAsync ( ) ;
439
+ }
427
440
}
428
441
}
0 commit comments