mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Migrated code from code behind pages to view models Auto select Recents if there are any recent items WIP auto focus on password box when opening database
38 lines
1.9 KiB
XML
38 lines
1.9 KiB
XML
<Page
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:viewModels="using:ModernKeePass.ViewModels"
|
|
xmlns:local="using:ModernKeePass.Controls"
|
|
xmlns:converters="using:ModernKeePass.Converters"
|
|
x:Class="ModernKeePass.Pages.RecentDatabasesPage"
|
|
mc:Ignorable="d">
|
|
<Page.Resources>
|
|
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
|
<CollectionViewSource x:Name="RecentItemsSource" Source="{Binding RecentItems}" />
|
|
</Page.Resources>
|
|
<Page.DataContext>
|
|
<viewModels:RecentVm/>
|
|
</Page.DataContext>
|
|
<ListView
|
|
Background="{StaticResource ApplicationPageBackgroundThemeBrush}"
|
|
ItemsSource="{Binding Source={StaticResource RecentItemsSource}}"
|
|
SelectionChanged="RecentListView_SelectionChanged"
|
|
SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Margin="10,0,10,0">
|
|
<TextBlock Text="{Binding Name}" Width="350" Padding="5" />
|
|
<local:OpenDatabaseUserControl Visibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" ValidationChecked="PasswordUserControl_PasswordChecked" />
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
<ListView.ItemContainerStyle>
|
|
<Style TargetType="ListViewItem">
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
</Style>
|
|
</ListView.ItemContainerStyle>
|
|
</ListView>
|
|
</Page> |