mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-04-17 18:16:28 +03:00
add password listing view
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using KeyKeeper.PasswordStore;
|
||||
|
||||
namespace KeyKeeper.ViewModels;
|
||||
@@ -6,6 +9,16 @@ public class UnlockedRepositoryViewModel : ViewModelBase
|
||||
{
|
||||
private IPassStore passStore;
|
||||
|
||||
public IEnumerable<PassStoreEntryPassword> Passwords
|
||||
{
|
||||
get
|
||||
{
|
||||
return passStore.GetRootDirectory()
|
||||
.Where(entry => entry is PassStoreEntryPassword)
|
||||
.Select(entry => (entry as PassStoreEntryPassword)!);
|
||||
}
|
||||
}
|
||||
|
||||
public UnlockedRepositoryViewModel(IPassStore store)
|
||||
{
|
||||
passStore = store;
|
||||
|
||||
@@ -49,6 +49,27 @@
|
||||
HorizontalAlignment="Left"
|
||||
Margin="0,20,0,0"/>
|
||||
</StackPanel>
|
||||
<ListBox Width="580"
|
||||
Margin="210 10 10 10"
|
||||
ItemsSource="{Binding Passwords}"
|
||||
Background="Transparent">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel Width="100" Margin="10" HorizontalAlignment="Center">
|
||||
<Svg Path="/Assets/logo_en.svg" Width="48" Height="48"/>
|
||||
<TextBlock Text="{Binding Name}"
|
||||
HorizontalAlignment="Center"
|
||||
Foreground="Black" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type vm:LockedRepositoryViewModel}">
|
||||
|
||||
Reference in New Issue
Block a user