Use ItemsControl for links
MODIFY
WalletWasabi.Fluent/ViewModels/HelpAndSupport/AboutViewModel.cs
WalletWasabi.Fluent/ViewModels/HelpAndSupport/AboutViewModel.cs
using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
using System.IO;
using System.Windows.Input;
using Avalonia;
@@ -26,6 +28,66 @@ namespace WalletWasabi.Fluent.ViewModels.HelpAndSupport
{
public AboutViewModel()
{
+ Links = new List<LinkViewModel>()
+ {
+ new ()
+ {
+ Link = DocsLink,
+ Description = "Documentation",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = SourceCodeLink,
+ Description = "Source Code (Github)",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = ClearnetLink,
+ Description = "Website (Clearnet)",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = TorLink,
+ Description = "Website (Tor)",
+ IsClickable = false,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = StatusPageLink,
+ Description = "Coordinator Status Page",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = UserSupportLink,
+ Description = "User Support",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = BugReportLink,
+ Description = "Bug Reporting",
+ IsClickable = true,
+ IsLast = false
+ },
+ new ()
+ {
+ Link = FAQLink,
+ Description = "FAQs",
+ IsClickable = true,
+ IsLast = true
+ },
+ };
+
OpenBrowserCommand = ReactiveCommand.CreateFromTask<string>(IoHelpers.OpenBrowserAsync);
AboutAdvancedInfoDialogCommand = ReactiveCommand.CreateFromTask(
@@ -44,6 +106,8 @@ namespace WalletWasabi.Fluent.ViewModels.HelpAndSupport
SetupCancel(enableCancel: false, enableCancelOnEscape: true, enableCancelOnPressed: true);
}
+ public List<LinkViewModel> Links { get; }
+
public ICommand AboutAdvancedInfoDialogCommand { get; }
public ICommand OpenBrowserCommand { get; }

ADD
WalletWasabi.Fluent/ViewModels/HelpAndSupport/LinkViewModel.cs
+using System.IO;
+using System.Windows.Input;
+using Avalonia;
+using ReactiveUI;
+
+namespace WalletWasabi.Fluent.ViewModels.HelpAndSupport
+{
+ public partial class LinkViewModel : ViewModelBase
+ {
+ public LinkViewModel()
+ {
+ OpenBrowserCommand = ReactiveCommand.CreateFromTask<string>(
+ async (link) =>
+ await IoHelpers.OpenBrowserAsync(link));
+
+ CopyLinkCommand = ReactiveCommand.CreateFromTask<string>(
+ async (link) =>
+ await Application.Current.Clipboard.SetTextAsync(link));
+ }
+
+ public string? Link { get; set; }
+
+ public string? Description { get; set; }
+
+ public bool IsClickable { get; set; }
+
+ public bool IsLast { get; set; }
+
+ public ICommand OpenBrowserCommand { get; }
+
+ public ICommand CopyLinkCommand { get; }
+ }
+}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/HelpAndSupport/AboutView.axaml
WalletWasabi.Fluent/Views/HelpAndSupport/AboutView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.HelpAndSupport"
xmlns:controls="using:WalletWasabi.Fluent.Controls"
- mc:Ignorable="d" d:DesignWidth="428" d:DesignHeight="371"
+ mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="600"
x:DataType="vm:AboutViewModel"
x:CompileBindings="True"
x:Class="WalletWasabi.Fluent.Views.HelpAndSupport.AboutView">
<DockPanel>
<StackPanel Spacing="10" DockPanel.Dock="Bottom" HorizontalAlignment="Center" Orientation="Vertical">
- <WrapPanel Margin="0 0 0 25" HorizontalAlignment="Center">
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain"
- Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.DocsLink}">
- <TextBlock Text="Documentation" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.DocsLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain" Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.SourceCodeLink}">
- <TextBlock Text="Source Code (Github)" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.SourceCodeLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain"
- Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.ClearnetLink}">
- <TextBlock Text="Website (Clearnet)" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.ClearnetLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <TextBlock Text="Website (Tor)" />
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.TorLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
+ <!-- Links -->
+ <ItemsControl Items="{Binding Links}"
+ Margin="0 0 0 25"
+ HorizontalAlignment="Center">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <WrapPanel/>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate DataType="vm:LinkViewModel">
+ <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
<Button Classes="plain"
Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.StatusPageLink}">
- <TextBlock Text="Coordinator Status Page" Classes="Hyperlink" />
+ CommandParameter="{Binding Link}"
+ IsVisible="{Binding IsClickable}">
+ <TextBlock Text="{Binding Description}" Classes="Hyperlink" />
</Button>
+ <TextBlock Text="{Binding Description}"
+ IsVisible="{Binding !IsClickable}"/>
<controls:AnimatedButton ToolTip.Tip="Copy link"
Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.StatusPageLink}"
+ CommandParameter="{Binding Link}"
NormalIcon="{StaticResource copy_regular}"
ClickIcon="{StaticResource copy_confirmed}" />
</StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain" Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.UserSupportLink}">
- <TextBlock Text="User Support" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.UserSupportLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
+ <TextBlock Classes="LinkSeparatorPadding"
+ IsVisible="{Binding !IsLast}"
+ Text="-" />
</StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain" Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.BugReportLink}">
- <TextBlock Text="Bug Reporting" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.BugReportLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- <TextBlock Classes="LinkSeparatorPadding" Text="-" />
- <StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
- <Button Classes="plain"
- Command="{Binding OpenBrowserCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.FAQLink}">
- <TextBlock Text="FAQs" Classes="Hyperlink" />
- </Button>
- <controls:AnimatedButton ToolTip.Tip="Copy link"
- Command="{Binding CopyLinkCommand}"
- CommandParameter="{x:Static vm:AboutViewModel.FAQLink}"
- NormalIcon="{StaticResource copy_regular}"
- ClickIcon="{StaticResource copy_confirmed}" />
- </StackPanel>
- </WrapPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ <!-- Advanced -->
<Button HorizontalAlignment="Center" Classes="plain obscured"
Command="{Binding AboutAdvancedInfoDialogCommand}">
<StackPanel Orientation="Horizontal" Spacing="5" Margin="2">
<TextBlock Text="Advanced Information..." Classes="Hyperlink" />
</StackPanel>
</Button>
+ <!-- License -->
<WrapPanel HorizontalAlignment="Center">
<TextBlock Margin=" 0 0 0 -0.5"
VerticalAlignment="Center"

Use ItemsControl for links