mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-02 04:46:31 +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;
|
using KeyKeeper.PasswordStore;
|
||||||
|
|
||||||
namespace KeyKeeper.ViewModels;
|
namespace KeyKeeper.ViewModels;
|
||||||
@@ -6,6 +9,16 @@ public class UnlockedRepositoryViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
private IPassStore passStore;
|
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)
|
public UnlockedRepositoryViewModel(IPassStore store)
|
||||||
{
|
{
|
||||||
passStore = store;
|
passStore = store;
|
||||||
|
|||||||
@@ -49,6 +49,27 @@
|
|||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,20,0,0"/>
|
Margin="0,20,0,0"/>
|
||||||
</StackPanel>
|
</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>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
<DataTemplate DataType="{x:Type vm:LockedRepositoryViewModel}">
|
<DataTemplate DataType="{x:Type vm:LockedRepositoryViewModel}">
|
||||||
|
|||||||
Reference in New Issue
Block a user