Skip to content

Commit 3da1ffa

Browse files
committed
Added a link to documentation in About view
1 parent 124d682 commit 3da1ffa

File tree

12 files changed

+112
-41
lines changed

12 files changed

+112
-41
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using SecureFolderFS.Shared.ComponentModel;
2+
3+
namespace SecureFolderFS.UI.AppModels
4+
{
5+
public sealed class ImageGlyph(string glyph, string? fontFamily = null) : IImage
6+
{
7+
/// <summary>
8+
/// Gets the glyph string to display.
9+
/// </summary>
10+
public string Glyph { get; } = glyph;
11+
12+
/// <summary>
13+
/// Gets the optional font family name of the glyph.
14+
/// </summary>
15+
public string? FontFamily { get; } = fontFamily;
16+
17+
/// <inheritdoc/>
18+
public void Dispose()
19+
{
20+
}
21+
}
22+
}

src/Platforms/SecureFolderFS.UI/Strings/en-US/Resources.resx

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -927,9 +927,12 @@
927927
<value>Version {0}</value>
928928
</data>
929929
<data name="AuthenticationUnavailableOrExpired" xml:space="preserve">
930-
<value>The configured authentication method is unavailable or has expired. Please use your recovery key.</value>
930+
<value>The configured authentication method is unavailable or has expired. Please use your recovery key.</value>
931931
</data>
932932
<data name="AuthenticationUnavailable" xml:space="preserve">
933-
<value>Authentication unavailable</value>
933+
<value>Authentication unavailable</value>
934+
</data>
935+
<data name="Documentation" xml:space="preserve">
936+
<value>Documentation</value>
934937
</data>
935-
</root>
938+
</root>

src/Platforms/SecureFolderFS.Uno/Dialogs/CredentialsDialog.xaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
ClickCommand="{x:Bind ItemSelectedCommand, Mode=OneWay}"
101101
Description="{l:ResourceString Rid=ChangeCurrentAuthentication}">
102102
<ucab:ActionBlockControl.Icon>
103-
<FontIcon Glyph="{x:Bind ConfiguredViewModel.Icon, Mode=OneWay}" />
103+
<IconSourceElement IconSource="{x:Bind ConfiguredViewModel.Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
104104
</ucab:ActionBlockControl.Icon>
105105
</ucab:ActionBlockControl>
106106
<ucab:ActionBlockControl
@@ -118,22 +118,30 @@
118118
<StackPanel Spacing="4">
119119
<TextBlock Style="{StaticResource SettingsSectionHeaderStyle}" Text="{l:ResourceString Rid=AllOptions}" />
120120
<ListView
121-
Margin="0"
122-
Padding="0"
123121
IsItemClickEnabled="False"
124122
ItemsSource="{x:Bind AuthenticationOptions, Mode=OneWay}"
125123
SelectionMode="None">
124+
<ListView.ItemContainerStyle>
125+
<Style TargetType="ListViewItem">
126+
<Setter Property="Template">
127+
<Setter.Value>
128+
<ControlTemplate TargetType="ListViewItem">
129+
<ListViewItemPresenter ContentMargin="0,0,0,4" />
130+
</ControlTemplate>
131+
</Setter.Value>
132+
</Setter>
133+
</Style>
134+
</ListView.ItemContainerStyle>
126135
<ListView.ItemTemplate>
127136
<DataTemplate x:DataType="vm2:AuthenticationViewModel">
128137
<ucab:ActionBlockControl
129138
Title="{x:Bind Title, Mode=OneWay}"
130-
Margin="0,0,0,4"
131139
BlockMode="Clickable"
132140
Click="ActionBlockControl_Click"
133141
DataContext="{Binding}"
134142
Description="{x:Bind Description, Mode=OneWay}">
135143
<ucab:ActionBlockControl.Icon>
136-
<FontIcon Glyph="{x:Bind Icon, Mode=OneWay}" />
144+
<IconSourceElement IconSource="{x:Bind Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
137145
</ucab:ActionBlockControl.Icon>
138146
</ucab:ActionBlockControl>
139147
</DataTemplate>
@@ -189,7 +197,7 @@
189197
BlockMode="Default"
190198
Description="{x:Bind ConfiguredViewModel.Description, Mode=OneWay}">
191199
<ucab:ActionBlockControl.Icon>
192-
<FontIcon Glyph="{x:Bind ConfiguredViewModel.Icon, Mode=OneWay}" />
200+
<IconSourceElement IconSource="{x:Bind ConfiguredViewModel.Icon, Mode=OneWay, Converter={StaticResource IconSourceConverter}}" />
193201
</ucab:ActionBlockControl.Icon>
194202
</ucab:ActionBlockControl>
195203
<TextBlock Opacity="0.8" Text="{l:ResourceString Rid=RemoveAuthenticationTip}" />

src/Platforms/SecureFolderFS.Uno/Platforms/Windows/ServiceImplementation/WindowsVaultCredentialsService.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using SecureFolderFS.Sdk.Services;
88
using SecureFolderFS.Sdk.ViewModels.Controls.Authentication;
99
using SecureFolderFS.Shared.Models;
10+
using SecureFolderFS.UI.AppModels;
1011
using SecureFolderFS.UI.ServiceImplementation;
1112
using SecureFolderFS.UI.ViewModels.Authentication;
1213
using SecureFolderFS.Uno.ViewModels;
@@ -29,15 +30,15 @@ public override async IAsyncEnumerable<AuthenticationViewModel> GetLoginAsync(IF
2930
yield return item switch
3031
{
3132
// Password
32-
Core.Constants.Vault.Authentication.AUTH_PASSWORD => new PasswordLoginViewModel(),
33+
Core.Constants.Vault.Authentication.AUTH_PASSWORD => new PasswordLoginViewModel() { Icon = new ImageGlyph("\uE8AC") },
3334

3435
// Windows Hello
3536
Core.Constants.Vault.Authentication.AUTH_WINDOWS_HELLO => await KeyCredentialManager.IsSupportedAsync().AsTask(cancellationToken)
3637
? new WindowsHelloLoginViewModel(vaultFolder, config.Uid)
3738
: throw new NotSupportedException($"The authentication method '{item}' is not supported by the platform."),
3839

3940
// Key File
40-
Core.Constants.Vault.Authentication.AUTH_KEYFILE => new KeyFileLoginViewModel(vaultFolder),
41+
Core.Constants.Vault.Authentication.AUTH_KEYFILE => new KeyFileLoginViewModel(vaultFolder) { Icon = new ImageGlyph("\uE8D7") },
4142

4243
_ => throw new NotSupportedException($"The authentication method '{item}' is not supported by the platform.")
4344
};
@@ -49,14 +50,14 @@ public override async IAsyncEnumerable<AuthenticationViewModel> GetCreationAsync
4950
[EnumeratorCancellation] CancellationToken cancellationToken = default)
5051
{
5152
// Password
52-
yield return new PasswordCreationViewModel();
53+
yield return new PasswordCreationViewModel() { Icon = new ImageGlyph("\uE8AC") };
5354

5455
// Windows Hello
5556
if (await KeyCredentialManager.IsSupportedAsync().AsTask(cancellationToken))
5657
yield return new WindowsHelloCreationViewModel(vaultFolder, vaultId);
5758

5859
// Key File
59-
yield return new KeyFileCreationViewModel(vaultId);
60+
yield return new KeyFileCreationViewModel(vaultId) { Icon = new ImageGlyph("\uE8D7") };
6061
}
6162
}
6263
}

src/Platforms/SecureFolderFS.Uno/ResourceDictionaries/ConverterResources.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
<vc:CountToBoolConverter x:Key="CountToBoolConverter" />
1111
<vc:NullToBoolConverter x:Key="NullToBoolConverter" />
1212
<vc:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
13+
<vc:IconSourceConverter x:Key="IconSourceConverter" />
1314

1415
</ResourceDictionary>

src/Platforms/SecureFolderFS.Uno/UserControls/InterfaceHost/MainAppHostControl.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<UserControl.Resources>
1818
<vc:BoolToStringConverter x:Key="BoolToStringConverter" />
1919
<vc:DateTimeToStringConverter x:Key="DateTimeToStringConverter" />
20-
<vc:IconSourceConverter x:Key="IconSourceConverter" />
2120
</UserControl.Resources>
2221

2322
<NavigationView

src/Platforms/SecureFolderFS.Uno/ValueConverters/IconSourceConverter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using System;
22
using Microsoft.UI.Xaml.Controls;
33
using Microsoft.UI.Xaml.Data;
4+
using Microsoft.UI.Xaml.Media;
5+
using SecureFolderFS.UI.AppModels;
46
using SecureFolderFS.Uno.AppModels;
57

68
namespace SecureFolderFS.Uno.ValueConverters
@@ -13,6 +15,11 @@ internal sealed class IconSourceConverter : IValueConverter
1315
return value switch
1416
{
1517
ImageBitmap bitmap => new ImageIconSource() { ImageSource = bitmap.Source },
18+
ImageGlyph glyph => glyph switch
19+
{
20+
{ FontFamily: not null } => new FontIconSource() { Glyph = glyph.Glyph, FontFamily = new FontFamily(glyph.FontFamily) },
21+
_ => new FontIconSource() { Glyph = glyph.Glyph },
22+
},
1623
_ => GetDefault()
1724
};
1825

src/Platforms/SecureFolderFS.Uno/ViewModels/WindowsHelloViewModel.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using SecureFolderFS.Sdk.ViewModels.Controls.Authentication;
1111
using SecureFolderFS.Shared.ComponentModel;
1212
using SecureFolderFS.Storage.Extensions;
13+
using SecureFolderFS.UI.AppModels;
1314
using Windows.Security.Credentials;
1415

1516
namespace SecureFolderFS.Uno.ViewModels
@@ -38,6 +39,7 @@ protected WindowsHelloViewModel(IFolder vaultFolder, string vaultId)
3839
: base(Core.Constants.Vault.Authentication.AUTH_WINDOWS_HELLO)
3940
{
4041
Title = "WindowsHello".ToLocalized();
42+
Icon = new ImageGlyph("\uEB68");
4143
VaultFolder = vaultFolder;
4244
VaultId = vaultId;
4345
}

src/Platforms/SecureFolderFS.Uno/Views/Settings/AboutSettingsPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
</ucab:ActionBlockControl.Icon>
168168
<ucab:ActionBlockControl.ActionElement>
169169
<StackPanel Orientation="Horizontal" Spacing="8">
170+
<HyperlinkButton Content="{l:ResourceString Rid=Documentation}" NavigateUri="https://github.com/securefolderfs-community/SecureFolderFS/wiki" />
170171
<HyperlinkButton Content="Discord" NavigateUri="https://discord.com/invite/NrTxXpJ2Zj" />
171172
</StackPanel>
172173
</ucab:ActionBlockControl.ActionElement>

src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultPropertiesPage.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
Opacity="0.6"
5555
Text="{x:Bind ViewModel.FileNameCipherText, Mode=OneWay}" />
5656
<TextBlock
57+
x:Name="FileSystemText"
5758
IsTextSelectionEnabled="True"
5859
Opacity="0.6"
5960
Text="{x:Bind ViewModel.ActiveFileSystemText, Mode=OneWay}"

0 commit comments

Comments
 (0)