Skip to content

Commit 9e75539

Browse files
Requested changes
1 parent 7304765 commit 9e75539

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/Files.App/Dialogs/CreateShortcutDialog.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,18 @@
7878

7979
<!-- Name Box -->
8080
<TextBox
81-
x:Name="ShortcutName"
81+
x:Name="ShortcutNameTextBox"
8282
Grid.Row="4"
8383
Grid.ColumnSpan="2"
8484
HorizontalAlignment="Stretch"
8585
Text="{x:Bind ViewModel.ShortcutName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
8686
<TextBox.Resources>
8787
<TeachingTip
88-
x:Name="InvalidNameWarning"
88+
x:Name="InvalidNameTeachingTip"
8989
Title="{helpers:ResourceString Name=InvalidFilename/Text}"
9090
IsOpen="{x:Bind ViewModel.ShowNameWarningTip, Mode=OneWay}"
91-
PreferredPlacement="Bottom" />
91+
PreferredPlacement="Bottom"
92+
Target="{x:Bind ShortcutNameTextBox}" />
9293
</TextBox.Resources>
9394
</TextBox>
9495
</Grid>

src/Files.App/ViewModels/Dialogs/CreateShortcutDialogViewModel.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public string ShortcutTarget
182182
}
183183
finally
184184
{
185-
SetDefaultName();
185+
AutoFillName();
186186
}
187187
}
188188
}
@@ -265,7 +265,7 @@ private async Task CreateShortcutAsync()
265265
ShortcutCreatedSuccessfully = await FileOperationsHelpers.CreateOrUpdateLinkAsync(filePath, FullPath, Arguments);
266266
}
267267

268-
private void SetDefaultName()
268+
private void AutoFillName()
269269
{
270270
if (DestinationPathExists)
271271
{
@@ -287,7 +287,7 @@ private void SetDefaultName()
287287
}
288288
ShortcutName = destinationName;
289289
}
290-
else
290+
else if (!string.IsNullOrEmpty(FullPath))
291291
{
292292
var uri = new Uri(FullPath);
293293
ShortcutName = uri.Host;

0 commit comments

Comments
 (0)