diff --git a/ModernKeePass/Actions/RestoreEntityAction.cs b/ModernKeePass/Actions/RestoreEntityAction.cs
deleted file mode 100644
index 851ef0d..0000000
--- a/ModernKeePass/Actions/RestoreEntityAction.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using System.Windows.Input;
-using Windows.UI.Xaml;
-using Microsoft.Xaml.Interactivity;
-using ModernKeePass.Common;
-using ModernKeePass.Interfaces;
-using ModernKeePass.Services;
-using ModernKeePass.ViewModels;
-
-namespace ModernKeePass.Actions
-{
- public class RestoreEntityAction : DependencyObject, IAction
- {
- public IPwEntity Entity
- {
- get { return (IPwEntity)GetValue(EntityProperty); }
- set { SetValue(EntityProperty, value); }
- }
-
- public static readonly DependencyProperty EntityProperty =
- DependencyProperty.Register("Entity", typeof(IPwEntity), typeof(RestoreEntityAction),
- new PropertyMetadata(null));
-
- public ICommand Command
- {
- get { return (ICommand)GetValue(CommandProperty); }
- set { SetValue(CommandProperty, value); }
- }
-
- public static readonly DependencyProperty CommandProperty =
- DependencyProperty.Register("Command", typeof(ICommand), typeof(RestoreEntityAction),
- new PropertyMetadata(null));
-
-
- public object Execute(object sender, object parameter)
- {
- var resource = new ResourcesService();
- var type = Entity is GroupVm ? "Group" : "Entry";
-
- ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityRestoredTitle"),
- resource.GetResourceValue($"{type}Restored"));
- Command.Execute(null);
-
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/ModernKeePass/Controls/TextBoxWithButton.cs b/ModernKeePass/Controls/TextBoxWithButton.cs
index 06d3475..f2820e8 100644
--- a/ModernKeePass/Controls/TextBoxWithButton.cs
+++ b/ModernKeePass/Controls/TextBoxWithButton.cs
@@ -1,6 +1,4 @@
using System;
-using System.Linq;
-using System.Reflection;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
diff --git a/ModernKeePass/ModernKeePass.App.csproj b/ModernKeePass/ModernKeePass.App.csproj
index 24d4f83..308ca1a 100644
--- a/ModernKeePass/ModernKeePass.App.csproj
+++ b/ModernKeePass/ModernKeePass.App.csproj
@@ -110,7 +110,6 @@
-
@@ -149,6 +148,9 @@
+
+ ImportExportPage.xaml
+
SettingsDatabasePage.xaml
@@ -267,6 +269,10 @@
MSBuild:Compile
PreserveNewest
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/ModernKeePass/Strings/en-US/Resources.resw b/ModernKeePass/Strings/en-US/Resources.resw
index 57ecd08..3fb91f0 100644
--- a/ModernKeePass/Strings/en-US/Resources.resw
+++ b/ModernKeePass/Strings/en-US/Resources.resw
@@ -477,4 +477,10 @@
Navigate to URL
+
+ Entry restored to its original position
+
+
+ Group restored to its original position
+
\ No newline at end of file
diff --git a/ModernKeePass/Strings/fr-FR/Resources.resw b/ModernKeePass/Strings/fr-FR/Resources.resw
index 850c3bb..90e7605 100644
--- a/ModernKeePass/Strings/fr-FR/Resources.resw
+++ b/ModernKeePass/Strings/fr-FR/Resources.resw
@@ -477,4 +477,10 @@
Naviguer vers l'URL
+
+ Entrée replacée à son emplacement d'origine
+
+
+ Groupe replacée à son emplacement d'origine
+
\ No newline at end of file
diff --git a/ModernKeePass/ViewModels/EntryVm.cs b/ModernKeePass/ViewModels/EntryVm.cs
index 63d7631..034c90f 100644
--- a/ModernKeePass/ViewModels/EntryVm.cs
+++ b/ModernKeePass/ViewModels/EntryVm.cs
@@ -228,7 +228,7 @@ namespace ModernKeePass.ViewModels
SaveCommand = new RelayCommand(() => _database.Save());
GeneratePasswordCommand = new RelayCommand(GeneratePassword);
- UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup));
+ UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup), () => PreviousGroup != null);
}
public void GeneratePassword()
diff --git a/ModernKeePass/ViewModels/GroupVm.cs b/ModernKeePass/ViewModels/GroupVm.cs
index 7516847..f47a902 100644
--- a/ModernKeePass/ViewModels/GroupVm.cs
+++ b/ModernKeePass/ViewModels/GroupVm.cs
@@ -84,7 +84,12 @@ namespace ModernKeePass.ViewModels
public bool IsEditMode
{
get { return _isEditMode; }
- set { SetProperty(ref _isEditMode, value); }
+ set
+ {
+ SetProperty(ref _isEditMode, value);
+ ((RelayCommand)SortEntriesCommand).RaiseCanExecuteChanged();
+ ((RelayCommand)SortGroupsCommand).RaiseCanExecuteChanged();
+ }
}
public bool IsMenuClosed
@@ -136,10 +141,10 @@ namespace ModernKeePass.ViewModels
SaveCommand = new RelayCommand(() => _database.Save());
SortEntriesCommand = new RelayCommand(async () =>
- await SortEntriesAsync().ConfigureAwait(false));
+ await SortEntriesAsync().ConfigureAwait(false), () => IsEditMode);
SortGroupsCommand = new RelayCommand(async () =>
- await SortGroupsAsync().ConfigureAwait(false));
- UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup));
+ await SortGroupsAsync().ConfigureAwait(false), () => IsEditMode);
+ UndoDeleteCommand = new RelayCommand(() => Move(PreviousGroup), () => PreviousGroup != null);
if (recycleBinId != null && _pwGroup.Uuid.Equals(recycleBinId)) _database.RecycleBin = this;
Entries = new ObservableCollection(pwGroup.Entries.Select(e => new EntryVm(e, this)));
@@ -186,6 +191,7 @@ namespace ModernKeePass.ViewModels
if (_database.RecycleBinEnabled && _database.RecycleBin?.IdUuid == null)
_database.CreateRecycleBin(recycleBinTitle);
Move(_database.RecycleBinEnabled && !IsSelected ? _database.RecycleBin : null);
+ ((RelayCommand)UndoDeleteCommand).RaiseCanExecuteChanged();
}
public void UndoDelete()
diff --git a/ModernKeePass/Views/EntryDetailPage.xaml b/ModernKeePass/Views/EntryDetailPage.xaml
index d377e58..3a8144e 100644
--- a/ModernKeePass/Views/EntryDetailPage.xaml
+++ b/ModernKeePass/Views/EntryDetailPage.xaml
@@ -529,7 +529,6 @@
RestoreButtonVisibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}"
DeleteButtonVisibility="{Binding IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}"
- IsRestoreButtonEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}"
SaveCommand="{Binding SaveCommand}"
RestoreCommand="{Binding UndoDeleteCommand}">
@@ -540,7 +539,8 @@
-
+
+
diff --git a/ModernKeePass/Views/GroupDetailPage.xaml b/ModernKeePass/Views/GroupDetailPage.xaml
index 77c5b3e..2b0982b 100644
--- a/ModernKeePass/Views/GroupDetailPage.xaml
+++ b/ModernKeePass/Views/GroupDetailPage.xaml
@@ -239,7 +239,6 @@
SortButtonVisibility="{Binding IsEditMode, Converter={StaticResource BooleanToVisibilityConverter}}"
IsEditButtonChecked="{Binding IsEditMode, Mode=TwoWay}"
IsDeleteButtonEnabled="{Binding IsNotRoot}"
- IsRestoreButtonEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}"
SaveCommand="{Binding SaveCommand}"
RestoreCommand="{Binding UndoDeleteCommand}"
SortEntriesCommand="{Binding SortEntriesCommand}"
@@ -252,7 +251,8 @@
-
+
+
diff --git a/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml b/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml
new file mode 100644
index 0000000..61c8908
--- /dev/null
+++ b/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml.cs b/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml.cs
new file mode 100644
index 0000000..84d43b6
--- /dev/null
+++ b/ModernKeePass/Views/MainPageFrames/ImportExportPage.xaml.cs
@@ -0,0 +1,35 @@
+using System;
+using Windows.Storage.Pickers;
+using Windows.UI.Xaml;
+
+// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace ModernKeePass.Views
+{
+ ///
+ /// The import/export page.
+ ///
+ public sealed partial class ImportExportPage
+ {
+ public ImportExportPage()
+ {
+ InitializeComponent();
+ }
+
+ private async void ImportFileButton_OnClick(object sender, RoutedEventArgs e)
+ {
+ var picker =
+ new FileOpenPicker
+ {
+ ViewMode = PickerViewMode.List,
+ SuggestedStartLocation = PickerLocationId.DocumentsLibrary
+ };
+ picker.FileTypeFilter.Add(".csv");
+
+ // Application now has read/write access to the picked file
+ var file = await picker.PickSingleFileAsync();
+ if (file == null) return;
+
+ }
+ }
+}
diff --git a/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml
index e5bdfe5..b308679 100644
--- a/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml
+++ b/ModernKeePass/Views/UserControls/TopMenuUserControl.xaml
@@ -18,7 +18,7 @@
-