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.Login), typeof(VaultListViewCell), null);
|
|
|
|
|
|
|
|
|
|
public VaultListViewCell(Action<VaultListPageModel.Login> moreClickedAction)
|
|
|
|
|
{
|
|
|
|
|
SetBinding(LoginParameterProperty, new Binding("."));
|
2017-05-30 21:13:53 +03:00
|
|
|
|
Label.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Login.Name));
|
|
|
|
|
Detail.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Login.Username));
|
|
|
|
|
LabelIcon.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Login.Shared));
|
2017-01-31 03:26:39 +03:00
|
|
|
|
|
|
|
|
|
Button.Image = "more";
|
2017-02-17 08:16:09 +03:00
|
|
|
|
Button.Command = new Command(() => moreClickedAction?.Invoke(LoginParameter));
|
2017-01-31 03:26:39 +03:00
|
|
|
|
Button.BackgroundColor = Color.Transparent;
|
|
|
|
|
|
2017-04-24 22:00:55 +03:00
|
|
|
|
LabelIcon.Source = "share";
|
|
|
|
|
|
2017-01-31 03:26:39 +03:00
|
|
|
|
BackgroundColor = Color.White;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public VaultListPageModel.Login LoginParameter
|
|
|
|
|
{
|
|
|
|
|
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Login; }
|
|
|
|
|
set { SetValue(LoginParameterProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|