1
0
mirror of https://github.com/bitwarden/mobile synced 2026-01-04 17:43:17 +00:00

more button on cipher listing

This commit is contained in:
Kyle Spearrin
2019-04-30 11:27:53 -04:00
parent 4a1bccd516
commit 5812dc7e7e
6 changed files with 54 additions and 9 deletions

View File

@@ -6,7 +6,8 @@
xmlns:u="clr-namespace:Bit.App.Utilities"
xmlns:controls="clr-namespace:Bit.App.Controls"
x:DataType="pages:GroupingsPageViewModel"
Title="{Binding PageTitle}">
Title="{Binding PageTitle}"
x:Name="_page">
<ContentPage.BindingContext>
<pages:GroupingsPageViewModel />
@@ -16,7 +17,9 @@
<ResourceDictionary>
<DataTemplate x:Key="cipherTemplate"
x:DataType="pages:GroupingsPageListItem">
<controls:CipherViewCell Cipher="{Binding Cipher}" />
<controls:CipherViewCell
Cipher="{Binding Cipher}"
ButtonCommand="{Binding BindingContext.CipherOptionsCommand, Source={x:Reference _page}}" />
</DataTemplate>
<DataTemplate x:Key="folderTemplate"

View File

@@ -43,6 +43,7 @@ namespace Bit.App.Pages
await LoadAsync();
});
AddCipherCommand = new Command(() => { /* TODO */ });
CipherOptionsCommand = new Command<CipherView>(CipherOptionsAsync);
}
public bool ShowFavorites { get; set; } = true;
@@ -99,6 +100,7 @@ namespace Bit.App.Pages
public ExtendedObservableCollection<GroupingsPageListGroup> GroupedItems { get; set; }
public Command RefreshCommand { get; set; }
public Command AddCipherCommand { get; set; }
public Command<CipherView> CipherOptionsCommand { get; set; }
public async Task LoadAsync()
{
@@ -273,5 +275,15 @@ namespace Bit.App.Pages
}
}
}
private async void CipherOptionsAsync(CipherView cipher)
{
var option = await Page.DisplayActionSheet(cipher.Name, AppResources.Cancel, null, "1", "2");
if(option == AppResources.Cancel)
{
return;
}
// TODO: process options
}
}
}