Added spaced card nubmer to the card view
This commit is contained in:
parent
9a9fb85ad8
commit
a91399b3a8
|
@ -21,6 +21,19 @@ namespace Bit.Core.Models.View
|
||||||
public string Code { get; set; }
|
public string Code { get; set; }
|
||||||
public string MaskedCode => Code != null ? new string('•', Code.Length) : null;
|
public string MaskedCode => Code != null ? new string('•', Code.Length) : null;
|
||||||
public string MaskedNumber => Number != null ? new string('•', Number.Length) : null;
|
public string MaskedNumber => Number != null ? new string('•', Number.Length) : null;
|
||||||
|
public string SpacedNumber {
|
||||||
|
get {
|
||||||
|
if (Number == null) return null;
|
||||||
|
var sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < Number.Length; i++) {
|
||||||
|
sb.Append(Number[i]);
|
||||||
|
if ((i + 1) % 4 == 0 && i + 1 < Number.Length) {
|
||||||
|
sb.Append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string Brand
|
public string Brand
|
||||||
{
|
{
|
||||||
|
|
|
@ -313,7 +313,7 @@
|
||||||
IsVisible="{Binding ShowCardNumber, Converter={StaticResource inverseBool}}"
|
IsVisible="{Binding ShowCardNumber, Converter={StaticResource inverseBool}}"
|
||||||
AutomationId="ItemValue" />
|
AutomationId="ItemValue" />
|
||||||
<controls:MonoLabel
|
<controls:MonoLabel
|
||||||
Text="{Binding Cipher.Card.Number, Mode=OneWay}"
|
Text="{Binding Cipher.Card.SpacedNumber, Mode=OneWay}"
|
||||||
StyleClass="box-value"
|
StyleClass="box-value"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
|
|
Loading…
Reference in New Issue