diff --git a/src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs b/src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs index 86e43e022..f454f2b55 100644 --- a/src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs +++ b/src/App/Controls/CipherViewCell/CipherViewCell.xaml.cs @@ -1,5 +1,4 @@ using System; -using System.Windows.Input; using Bit.App.Abstractions; using Bit.Core.Models.View; using Bit.Core.Utilities; @@ -19,7 +18,7 @@ namespace Bit.App.Controls nameof(WebsiteIconsEnabled), typeof(bool?), typeof(CipherViewCell)); public static readonly BindableProperty ButtonCommandProperty = BindableProperty.Create( - nameof(ButtonCommand), typeof(ICommand), typeof(CipherViewCell)); + nameof(ButtonCommand), typeof(Command), typeof(CipherViewCell)); public CipherViewCell() { @@ -43,9 +42,9 @@ namespace Bit.App.Controls set => SetValue(CipherProperty, value); } - public ICommand ButtonCommand + public Command ButtonCommand { - get => GetValue(ButtonCommandProperty) as ICommand; + get => GetValue(ButtonCommandProperty) as Command; set => SetValue(ButtonCommandProperty, value); } diff --git a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs index 8b4af6a02..36b7d71da 100644 --- a/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs +++ b/src/App/Pages/Vault/GroupingsPage/GroupingsPageViewModel.cs @@ -78,9 +78,7 @@ namespace Bit.App.Pages Refreshing = true; await LoadAsync(); }); - CipherOptionsCommand = new AsyncCommand(cipher => AppHelpers.CipherListOptions(Page, cipher, _passwordRepromptService), - onException: ex => _logger.Exception(ex), - allowsMultipleExecutions: false); + CipherOptionsCommand = new Command(CipherOptionsAsync); VaultFilterCommand = new AsyncCommand(VaultFilterOptionsAsync, onException: ex => _logger.Exception(ex), allowsMultipleExecutions: false); @@ -170,7 +168,7 @@ namespace Bit.App.Pages public AccountSwitchingOverlayViewModel AccountSwitchingOverlayViewModel { get; } public ObservableRangeCollection GroupedItems { get; set; } public Command RefreshCommand { get; set; } - public ICommand CipherOptionsCommand { get; } + public Command CipherOptionsCommand { get; set; } public bool LoadedOnce { get; set; } public async Task LoadAsync() @@ -711,5 +709,13 @@ namespace Bit.App.Pages var folders = decFolders.Where(f => _allCiphers.Any(c => c.FolderId == f.Id)).ToList(); return folders.Any() ? folders : null; } + + private async void CipherOptionsAsync(CipherView cipher) + { + if ((Page as BaseContentPage).DoOnce()) + { + await AppHelpers.CipherListOptions(Page, cipher, _passwordRepromptService); + } + } } }