Skip to content

Commit fd18e70

Browse files
authored
Code Quality: Added support for clinking links in the release notes (#15545)
1 parent 9f6f55f commit fd18e70

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Files.App/Dialogs/ReleaseNotesDialog.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969
HorizontalScrollMode="Auto"
7070
VerticalScrollMode="Auto">
7171
<controls:MarkdownTextBlock
72+
x:Name="ReleaseNotesMarkdownTextBlock"
7273
Background="Transparent"
74+
LinkClicked="ReleaseNotesMarkdownTextBlock_LinkClicked"
7375
ListGutterWidth="16"
7476
Text="{x:Bind ViewModel.ReleaseNotesMadrkdown, Mode=OneWay}" />
7577
</ScrollViewer>

src/Files.App/Dialogs/ReleaseNotesDialog.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using Microsoft.UI.Xaml;
55
using Microsoft.UI.Xaml.Controls;
6+
using Windows.System;
67

78
namespace Files.App.Dialogs
89
{
@@ -58,5 +59,11 @@ private ContentDialog SetContentDialogRoot(ContentDialog contentDialog)
5859

5960
return contentDialog;
6061
}
62+
63+
private async void ReleaseNotesMarkdownTextBlock_LinkClicked(object sender, CommunityToolkit.WinUI.UI.Controls.LinkClickedEventArgs e)
64+
{
65+
if (Uri.TryCreate(e.Link, UriKind.Absolute, out Uri? link))
66+
await Launcher.LaunchUriAsync(link);
67+
}
6168
}
6269
}

0 commit comments

Comments
 (0)