bitwarden-android/src/App/Controls/VaultListViewCell.cs

37 lines
1.5 KiB
C#
Raw Normal View History

2017-01-31 03:26:39 +03:00
using Bit.App.Models.Page;
using System;
using Xamarin.Forms;
namespace Bit.App.Controls
{
public class VaultListViewCell : LabeledDetailCell
{
public static readonly BindableProperty LoginParameterProperty = BindableProperty.Create(nameof(LoginParameter),
typeof(VaultListPageModel.Cipher), typeof(VaultListViewCell), null);
2017-01-31 03:26:39 +03:00
public VaultListViewCell(Action<VaultListPageModel.Cipher> moreClickedAction)
2017-01-31 03:26:39 +03:00
{
SetBinding(LoginParameterProperty, new Binding("."));
Label.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Name));
Detail.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Subtitle));
LabelIcon.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.Shared));
LabelIcon2.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.HasAttachments));
2017-01-31 03:26:39 +03:00
2017-10-20 20:03:04 +03:00
Button.Image = "more.png";
Button.Command = new Command(() => moreClickedAction?.Invoke(LoginParameter));
2017-01-31 03:26:39 +03:00
Button.BackgroundColor = Color.Transparent;
2017-10-20 20:03:04 +03:00
LabelIcon.Source = "share.png";
LabelIcon2.Source = "paperclip.png";
2017-04-24 22:00:55 +03:00
2017-01-31 03:26:39 +03:00
BackgroundColor = Color.White;
}
public VaultListPageModel.Cipher LoginParameter
2017-01-31 03:26:39 +03:00
{
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Cipher; }
2017-01-31 03:26:39 +03:00
set { SetValue(LoginParameterProperty, value); }
}
}
}