2017-01-31 03:26:39 +03:00
|
|
|
|
using Bit.App.Models.Page;
|
2017-10-20 22:24:40 +03:00
|
|
|
|
using FFImageLoading.Forms;
|
2017-01-31 03:26:39 +03:00
|
|
|
|
using System;
|
|
|
|
|
using Xamarin.Forms;
|
|
|
|
|
|
|
|
|
|
namespace Bit.App.Controls
|
|
|
|
|
{
|
|
|
|
|
public class VaultListViewCell : LabeledDetailCell
|
|
|
|
|
{
|
|
|
|
|
public static readonly BindableProperty LoginParameterProperty = BindableProperty.Create(nameof(LoginParameter),
|
2017-10-19 04:35:33 +03:00
|
|
|
|
typeof(VaultListPageModel.Cipher), typeof(VaultListViewCell), null);
|
2017-01-31 03:26:39 +03:00
|
|
|
|
|
2017-10-19 04:35:33 +03:00
|
|
|
|
public VaultListViewCell(Action<VaultListPageModel.Cipher> moreClickedAction)
|
2017-01-31 03:26:39 +03:00
|
|
|
|
{
|
|
|
|
|
SetBinding(LoginParameterProperty, new Binding("."));
|
2017-10-20 22:24:40 +03:00
|
|
|
|
Icon.SetBinding(CachedImage.SourceProperty, nameof(VaultListPageModel.Cipher.Icon));
|
|
|
|
|
Icon.SetBinding(CachedImage.LoadingPlaceholderProperty, nameof(VaultListPageModel.Cipher.Icon));
|
2017-10-19 04:35:33 +03:00
|
|
|
|
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";
|
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-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;
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-19 04:35:33 +03:00
|
|
|
|
public VaultListPageModel.Cipher LoginParameter
|
2017-01-31 03:26:39 +03:00
|
|
|
|
{
|
2017-10-19 04:35:33 +03:00
|
|
|
|
get { return GetValue(LoginParameterProperty) as VaultListPageModel.Cipher; }
|
2017-01-31 03:26:39 +03:00
|
|
|
|
set { SetValue(LoginParameterProperty, value); }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|