mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-04 08:00:16 -04:00
Corrected then broke again data binding...
Lib now uses more nuget packages
This commit is contained in:
@@ -7,23 +7,11 @@
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ViewModels="using:ModernKeePass.ViewModels"
|
||||
x:Name="pageRoot"
|
||||
x:Class="ModernKeePass.Pages.DatabaseDetailPage"
|
||||
DataContext="{Binding ViewModel, RelativeSource={RelativeSource Self}}"
|
||||
x:Class="ModernKeePass.Pages.GroupDetailPage"
|
||||
DataContext="{Binding ViewModel, Mode=OneWay, RelativeSource={RelativeSource Mode=Self}}"
|
||||
mc:Ignorable="d">
|
||||
<!--<Page.DataContext>
|
||||
<ViewModels:DatabaseVm />
|
||||
</Page.DataContext>-->
|
||||
<Page.Resources>
|
||||
<!-- Collection of items displayed by this page -->
|
||||
<CollectionViewSource
|
||||
x:Name="itemsViewSource"
|
||||
Source="{Binding Groups}"/>
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
<Grid.DataContext>
|
||||
<ViewModels:DatabaseVm/>
|
||||
</Grid.DataContext>
|
||||
<Grid.ChildrenTransitions>
|
||||
<TransitionCollection>
|
||||
<EntranceThemeTransition/>
|
||||
@@ -34,6 +22,11 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Grid.Resources>
|
||||
<CollectionViewSource
|
||||
x:Name="itemsViewSource"
|
||||
Source="{Binding Groups}"/>
|
||||
</Grid.Resources>
|
||||
<!-- Horizontal scrolling grid -->
|
||||
<GridView
|
||||
x:Name="itemGridView"
|
||||
@@ -48,9 +41,6 @@
|
||||
<GridView.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<Grid Height="110" Width="480" Margin="10">
|
||||
<Grid.DataContext>
|
||||
<ViewModels:GroupVm/>
|
||||
</Grid.DataContext>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -59,9 +49,9 @@
|
||||
<Image Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
|
||||
</Border>
|
||||
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="10,0,0,0">
|
||||
<TextBlock Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap" Text="{Binding Name}"/>
|
||||
<TextBlock Text="{Binding Name}" Style="{StaticResource TitleTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Style="{StaticResource CaptionTextBlockStyle}" TextWrapping="NoWrap"/>
|
||||
<TextBlock Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
<TextBlock Text="{Binding EntryCount}" Style="{StaticResource BodyTextBlockStyle}" MaxHeight="60"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DataTemplate>
|
@@ -2,7 +2,6 @@
|
||||
using Windows.UI.Xaml.Controls;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using ModernKeePass.ViewModels;
|
||||
using Windows.Storage;
|
||||
|
||||
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
||||
|
||||
@@ -12,14 +11,14 @@ namespace ModernKeePass.Pages
|
||||
/// A page that displays an overview of a single group, including a preview of the items
|
||||
/// within the group.
|
||||
/// </summary>
|
||||
public sealed partial class DatabaseDetailPage : Page
|
||||
public sealed partial class GroupDetailPage : Page
|
||||
{
|
||||
private NavigationHelper navigationHelper;
|
||||
private DatabaseVm viewModel = new DatabaseVm();
|
||||
private GroupVm viewModel;
|
||||
|
||||
public DatabaseVm ViewModel
|
||||
public GroupVm ViewModel
|
||||
{
|
||||
get { return this.viewModel; }
|
||||
get { return viewModel; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -32,7 +31,7 @@ namespace ModernKeePass.Pages
|
||||
}
|
||||
|
||||
|
||||
public DatabaseDetailPage()
|
||||
public GroupDetailPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
this.navigationHelper = new NavigationHelper(this);
|
||||
@@ -71,10 +70,9 @@ namespace ModernKeePass.Pages
|
||||
{
|
||||
navigationHelper.OnNavigatedTo(e);
|
||||
|
||||
if (e.Parameter is StorageFile)
|
||||
if (e.Parameter is GroupVm)
|
||||
{
|
||||
var file = e.Parameter as StorageFile;
|
||||
viewModel.Open(file, "test");
|
||||
viewModel = e.Parameter as GroupVm;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user