mirror of
https://github.com/bitwarden/mobile
synced 2025-12-20 10:13:42 +00:00
vault groupings page list view stubbed
This commit is contained in:
@@ -1,14 +1,93 @@
|
||||
using System;
|
||||
using Bit.Core.Models.View;
|
||||
using Bit.Core.Utilities;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Xamarin.Forms;
|
||||
|
||||
namespace Bit.App.Pages
|
||||
{
|
||||
public class VaultGroupingsPageViewModel : BaseViewModel
|
||||
{
|
||||
private bool _loading = false;
|
||||
|
||||
public VaultGroupingsPageViewModel()
|
||||
{
|
||||
PageTitle = "My Vault";
|
||||
Items = new ExtendedObservableCollection<VaultGroupingsPageListItem>();
|
||||
LoadCommand = new Command(async () => await LoadAsync());
|
||||
}
|
||||
|
||||
public bool Loading
|
||||
{
|
||||
get => _loading;
|
||||
set => SetProperty(ref _loading, value);
|
||||
}
|
||||
public ExtendedObservableCollection<VaultGroupingsPageListItem> Items { get; set; }
|
||||
public Command LoadCommand { get; set; }
|
||||
|
||||
public Task LoadAsync()
|
||||
{
|
||||
if(Loading)
|
||||
{
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
Loading = true;
|
||||
|
||||
try
|
||||
{
|
||||
Items.ResetWithRange(new List<VaultGroupingsPageListItem>
|
||||
{
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Cipher = new CipherView { Name = "Cipher 1" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Cipher = new CipherView { Name = "Cipher 2" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Cipher = new CipherView { Name = "Cipher 3" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Cipher = new CipherView { Name = "Cipher 4" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Folder = new FolderView { Name = "Folder 1" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Folder = new FolderView { Name = "Folder 2" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Folder = new FolderView { Name = "Folder 3" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Collection = new Core.Models.View.CollectionView { Name = "Collection 1" }
|
||||
},
|
||||
new VaultGroupingsPageListItem
|
||||
{
|
||||
Collection = new Core.Models.View.CollectionView { Name = "Collection 2" }
|
||||
},
|
||||
});
|
||||
}
|
||||
finally
|
||||
{
|
||||
Loading = false;
|
||||
}
|
||||
|
||||
return Task.FromResult(0);
|
||||
}
|
||||
}
|
||||
|
||||
public class VaultGroupingsPageListItem
|
||||
{
|
||||
public FolderView Folder { get; set; }
|
||||
public Core.Models.View.CollectionView Collection { get; set; }
|
||||
public CipherView Cipher { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user