mirror of
https://github.com/bitwarden/mobile
synced 2025-12-11 22:03:27 +00:00
cipher view cell control
This commit is contained in:
34
src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs
Normal file
34
src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using Bit.Core.Models.View;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Controls
|
||||
{
|
||||
public partial class CipherViewCell : ViewCell
|
||||
{
|
||||
public static readonly BindableProperty CipherProperty = BindableProperty.Create(
|
||||
nameof(Cipher), typeof(CipherView), typeof(CipherViewCell), default(CipherView), BindingMode.OneWay);
|
||||
|
||||
private CipherViewCellViewModel _viewModel;
|
||||
|
||||
public CipherViewCell()
|
||||
{
|
||||
InitializeComponent();
|
||||
_viewModel = _layout.BindingContext as CipherViewCellViewModel;
|
||||
}
|
||||
|
||||
public CipherView Cipher
|
||||
{
|
||||
get => GetValue(CipherProperty) as CipherView;
|
||||
set => SetValue(CipherProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnPropertyChanged(string propertyName = null)
|
||||
{
|
||||
base.OnPropertyChanged(propertyName);
|
||||
if(propertyName == CipherProperty.PropertyName)
|
||||
{
|
||||
_viewModel.Cipher = Cipher;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user