diff --git a/src/App/Models/ViewFieldViewModel.cs b/src/App/Models/ViewFieldViewModel.cs
new file mode 100644
index 000000000..e3bd62961
--- /dev/null
+++ b/src/App/Models/ViewFieldViewModel.cs
@@ -0,0 +1,25 @@
+using Bit.App.Pages;
+using Bit.Core.Models.View;
+
+namespace Bit.App.Models
+{
+ public class ViewFieldViewModel : BaseViewModel
+ {
+ private FieldView _field;
+
+ public ViewFieldViewModel(FieldView field)
+ {
+ Field = field;
+ }
+
+ public FieldView Field
+ {
+ get => _field;
+ set => SetProperty(ref _field, value,
+ additionalPropertyNames: new string[]
+ {
+
+ });
+ }
+ }
+}
diff --git a/src/App/Pages/Vault/ViewPage.xaml b/src/App/Pages/Vault/ViewPage.xaml
index d64e29036..a52f37656 100644
--- a/src/App/Pages/Vault/ViewPage.xaml
+++ b/src/App/Pages/Vault/ViewPage.xaml
@@ -7,6 +7,7 @@
xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:controls="clr-namespace:Bit.App.Controls"
xmlns:views="clr-namespace:Bit.Core.Models.View;assembly=BitwardenCore"
+ xmlns:models="clr-namespace:Bit.App.Models"
x:DataType="pages:ViewPageViewModel"
x:Name="_page"
Title="{Binding PageTitle}">
@@ -18,6 +19,12 @@
+
+
+
+
+
+
@@ -167,7 +174,14 @@
Text="{u:I18n URI}"
StyleClass="box-label"
Grid.Row="0"
- Grid.Column="0" />
+ Grid.Column="0"
+ IsVisible="{Binding IsWebsite, Mode=OneWay, Converter={StaticResource inverseBool}}" />
+
+ Grid.RowSpan="2"
+ IsVisible="{Binding CanLaunch, Mode=OneWay}" />
-
+
-
+
@@ -229,12 +244,12 @@
@@ -242,7 +257,7 @@
StyleClass="box-row-button, box-row-button-platform"
Text=""
Command="{Binding BindingContext.CopyFieldCommand, Source={x:Reference _page}}"
- CommandParameter="{Binding .}"
+ CommandParameter="{Binding Field}"
Grid.Row="0"
Grid.Column="1"
Grid.RowSpan="2" />
diff --git a/src/App/Pages/Vault/ViewPageViewModel.cs b/src/App/Pages/Vault/ViewPageViewModel.cs
index e45cdfdda..d8997ba76 100644
--- a/src/App/Pages/Vault/ViewPageViewModel.cs
+++ b/src/App/Pages/Vault/ViewPageViewModel.cs
@@ -1,9 +1,12 @@
using Bit.App.Abstractions;
+using Bit.App.Models;
using Bit.App.Resources;
using Bit.Core.Abstractions;
using Bit.Core.Models.View;
using Bit.Core.Utilities;
using System;
+using System.Collections.Generic;
+using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
@@ -17,6 +20,7 @@ namespace Bit.App.Pages
private readonly ITotpService _totpService;
private readonly IPlatformUtilsService _platformUtilsService;
private CipherView _cipher;
+ private List _fields;
private bool _canAccessPremium;
private string _totpCode;
private string _totpCodeFormatted;
@@ -58,6 +62,11 @@ namespace Bit.App.Pages
nameof(ShowTotp)
});
}
+ public List Fields
+ {
+ get => _fields;
+ set => SetProperty(ref _fields, value);
+ }
public bool CanAccessPremium
{
get => _canAccessPremium;
@@ -102,6 +111,7 @@ namespace Bit.App.Pages
var cipher = await _cipherService.GetAsync(CipherId);
Cipher = await cipher.DecryptAsync();
CanAccessPremium = await _userService.CanAccessPremiumAsync();
+ Fields = Cipher.Fields?.Select(f => new ViewFieldViewModel(f)).ToList();
if(Cipher.Type == Core.Enums.CipherType.Login && !string.IsNullOrWhiteSpace(Cipher.Login.Totp) &&
(Cipher.OrganizationUseTotp || CanAccessPremium))
diff --git a/src/App/Utilities/InverseBoolConverter.cs b/src/App/Utilities/InverseBoolConverter.cs
new file mode 100644
index 000000000..d5affc66e
--- /dev/null
+++ b/src/App/Utilities/InverseBoolConverter.cs
@@ -0,0 +1,28 @@
+using System;
+using Xamarin.Forms;
+
+namespace Bit.App.Utilities
+{
+ public class InverseBoolConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter,
+ System.Globalization.CultureInfo culture)
+ {
+ if(targetType == typeof(bool))
+ {
+ return !(bool)value;
+ }
+ if(targetType == typeof(bool?))
+ {
+ return !((bool?)value).GetValueOrDefault();
+ }
+ throw new InvalidOperationException("The target must be a boolean.");
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter,
+ System.Globalization.CultureInfo culture)
+ {
+ throw new NotSupportedException();
+ }
+ }
+}