@@ -19,11 +19,11 @@ public static DynamicDialog GetFor_PropertySaveErrorDialog()
1919 {
2020 DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
2121 {
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 ( ) ,
2727 DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Secondary | DynamicDialogButtons . Cancel
2828 } ) ;
2929 return dialog ;
@@ -33,9 +33,9 @@ public static DynamicDialog GetFor_ConsentDialog()
3333 {
3434 DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
3535 {
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 ( ) ,
3939 PrimaryButtonAction = async ( vm , e ) => await Launcher . LaunchUriAsync ( new Uri ( "ms-settings:privacy-broadfilesystemaccess" ) ) ,
4040 DynamicButtons = DynamicDialogButtons . Primary
4141 } ) ;
@@ -46,10 +46,10 @@ public static DynamicDialog GetFor_ShortcutNotFound(string targetPath)
4646 {
4747 DynamicDialog dialog = new ( new DynamicDialogViewModel
4848 {
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 ( ) ,
5353 DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Secondary
5454 } ) ;
5555 return dialog ;
@@ -60,12 +60,12 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
6060 DynamicDialog ? dialog = null ;
6161 TextBox inputText = new ( )
6262 {
63- PlaceholderText = " EnterAnItemName" . GetLocalizedResource ( )
63+ PlaceholderText = Strings . EnterAnItemName . GetLocalizedResource ( )
6464 } ;
6565
6666 TeachingTip warning = new ( )
6767 {
68- Title = "InvalidFilename/Text" . GetLocalizedResource ( ) ,
68+ Title = Strings . InvalidFilename_Text . GetLocalizedResource ( ) ,
6969 PreferredPlacement = TeachingTipPlacementMode . Bottom ,
7070 DataContext = new CreateItemDialogViewModel ( ) ,
7171 } ;
@@ -101,7 +101,7 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
101101
102102 dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
103103 {
104- TitleText = string . Format ( " CreateNewItemTitle" . GetLocalizedResource ( ) , itemType ) ,
104+ TitleText = string . Format ( Strings . CreateNewItemTitle . GetLocalizedResource ( ) , itemType ) ,
105105 SubtitleText = null ,
106106 DisplayControl = new Grid ( )
107107 {
@@ -115,8 +115,8 @@ public static DynamicDialog GetFor_CreateItemDialog(string itemType)
115115 {
116116 vm . HideDialog ( ) ; // Rename successful
117117 } ,
118- PrimaryButtonText = " Create" . GetLocalizedResource ( ) ,
119- CloseButtonText = " Cancel" . GetLocalizedResource ( ) ,
118+ PrimaryButtonText = Strings . Create . GetLocalizedResource ( ) ,
119+ CloseButtonText = Strings . Cancel . GetLocalizedResource ( ) ,
120120 DynamicButtonsEnabled = DynamicDialogButtons . Cancel ,
121121 DynamicButtons = DynamicDialogButtons . Primary | DynamicDialogButtons . Cancel
122122 } ) ;
@@ -133,9 +133,9 @@ public static DynamicDialog GetFor_FileInUseDialog(List<Win32Process> lockingPro
133133 {
134134 DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
135135 {
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 } )") ) ) ,
139139 PrimaryButtonText = "OK" ,
140140 DynamicButtons = DynamicDialogButtons . Primary
141141 } ) ;
@@ -149,17 +149,17 @@ public static DynamicDialog GetFor_CredentialEntryDialog(string path)
149149
150150 TextBox inputUsername = new ( )
151151 {
152- PlaceholderText = "CredentialDialogUserName/PlaceholderText" . GetLocalizedResource ( )
152+ PlaceholderText = Strings . CredentialDialogUserName_PlaceholderText . GetLocalizedResource ( )
153153 } ;
154154
155155 PasswordBox inputPassword = new ( )
156156 {
157- PlaceholderText = " Password" . GetLocalizedResource ( )
157+ PlaceholderText = Strings . Password . GetLocalizedResource ( )
158158 } ;
159159
160160 CheckBox saveCreds = new ( )
161161 {
162- Content = " NetworkAuthenticationSaveCheckbox" . GetLocalizedResource ( )
162+ Content = Strings . NetworkAuthenticationSaveCheckbox . GetLocalizedResource ( )
163163 } ;
164164
165165 inputUsername . TextChanged += ( textBox , args ) =>
@@ -188,10 +188,10 @@ public static DynamicDialog GetFor_CredentialEntryDialog(string path)
188188
189189 dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
190190 {
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 ) ) ,
195195 DisplayControl = new Grid ( )
196196 {
197197 MinWidth = 250d ,
@@ -228,9 +228,9 @@ public static DynamicDialog GetFor_GitCheckoutConflicts(string checkoutBranchNam
228228 {
229229 ItemsSource = new string [ ]
230230 {
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 ( )
234234 } ,
235235 SelectionMode = ListViewSelectionMode . Single
236236 } ;
@@ -243,10 +243,10 @@ public static DynamicDialog GetFor_GitCheckoutConflicts(string checkoutBranchNam
243243
244244 dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
245245 {
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 ( ) ,
250250 DisplayControl = new Grid ( )
251251 {
252252 MinWidth = 250d ,
@@ -271,8 +271,8 @@ public static DynamicDialog GetFor_GitHubConnectionError()
271271 DynamicDialog dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
272272 {
273273 TitleText = "Error" . GetLocalizedResource ( ) ,
274- SubtitleText = " CannotReachGitHubError" . GetLocalizedResource ( ) ,
275- PrimaryButtonText = " Close" . GetLocalizedResource ( ) ,
274+ SubtitleText = Strings . CannotReachGitHubError . GetLocalizedResource ( ) ,
275+ PrimaryButtonText = Strings . Close . GetLocalizedResource ( ) ,
276276 DynamicButtons = DynamicDialogButtons . Primary
277277 } ) ;
278278 return dialog ;
@@ -283,8 +283,8 @@ public static DynamicDialog GetFor_GitCannotInitializeqRepositoryHere()
283283 return new DynamicDialog ( new DynamicDialogViewModel ( )
284284 {
285285 TitleText = "Error" . GetLocalizedResource ( ) ,
286- SubtitleText = " CannotInitializeGitRepo" . GetLocalizedResource ( ) ,
287- PrimaryButtonText = " Close" . GetLocalizedResource ( ) ,
286+ SubtitleText = Strings . CannotInitializeGitRepo . GetLocalizedResource ( ) ,
287+ PrimaryButtonText = Strings . Close . GetLocalizedResource ( ) ,
288288 DynamicButtons = DynamicDialogButtons . Primary
289289 } ) ;
290290 }
@@ -294,10 +294,10 @@ public static DynamicDialog GetFor_DeleteGitBranchConfirmation(string branchName
294294 DynamicDialog dialog = null ! ;
295295 dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
296296 {
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 ( ) ,
301301 AdditionalData = true ,
302302 CloseButtonAction = ( vm , e ) =>
303303 {
@@ -314,10 +314,10 @@ public static DynamicDialog GetFor_RenameRequiresHigherPermissions(string path)
314314 DynamicDialog dialog = null ! ;
315315 dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
316316 {
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 ( ) ,
321321 SecondaryButtonAction = ( vm , e ) =>
322322 {
323323 var context = Ioc . Default . GetRequiredService < IContentPageContext > ( ) ;
@@ -424,5 +424,18 @@ await commands.OpenSettings.ExecuteAsync(
424424 new SettingsNavigationParams ( ) { PageKind = SettingsPageKind . DevToolsPage }
425425 ) ;
426426 }
427+
428+ public static async Task ShowFor_CannotCloneRepo ( string exception )
429+ {
430+ var dialog = new DynamicDialog ( new DynamicDialogViewModel ( )
431+ {
432+ TitleText = Strings . CannotCloneRepoTitle . GetLocalizedResource ( ) ,
433+ SubtitleText = exception ,
434+ PrimaryButtonText = Strings . OK . GetLocalizedResource ( ) ,
435+ DynamicButtons = DynamicDialogButtons . Primary
436+ } ) ;
437+
438+ await dialog . TryShowAsync ( ) ;
439+ }
427440 }
428441}
0 commit comments