mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Finally a workaround the stupid CommandBar DataContext issues
Delete and Restore actions now work as intended Renamed styles folder
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
using Windows.UI.Xaml;
|
using System.Windows.Input;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml;
|
||||||
using Microsoft.Xaml.Interactivity;
|
using Microsoft.Xaml.Interactivity;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
@@ -20,14 +20,14 @@ namespace ModernKeePass.Actions
|
|||||||
DependencyProperty.Register("Entity", typeof(IPwEntity), typeof(DeleteEntityAction),
|
DependencyProperty.Register("Entity", typeof(IPwEntity), typeof(DeleteEntityAction),
|
||||||
new PropertyMetadata(null));
|
new PropertyMetadata(null));
|
||||||
|
|
||||||
public Frame Frame
|
public ICommand Command
|
||||||
{
|
{
|
||||||
get { return (Frame)GetValue(FrameProperty); }
|
get { return (ICommand)GetValue(CommandProperty); }
|
||||||
set { SetValue(FrameProperty, value); }
|
set { SetValue(CommandProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty FrameProperty =
|
public static readonly DependencyProperty CommandProperty =
|
||||||
DependencyProperty.Register("Frame", typeof(Frame), typeof(DeleteEntityAction),
|
DependencyProperty.Register("Command", typeof(ICommand), typeof(DeleteEntityAction),
|
||||||
new PropertyMetadata(null));
|
new PropertyMetadata(null));
|
||||||
|
|
||||||
public object Execute(object sender, object parameter)
|
public object Execute(object sender, object parameter)
|
||||||
@@ -45,7 +45,7 @@ namespace ModernKeePass.Actions
|
|||||||
{
|
{
|
||||||
ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityDeleting"), text);
|
ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityDeleting"), text);
|
||||||
Entity.MarkForDelete(resource.GetResourceValue("RecycleBinTitle"));
|
Entity.MarkForDelete(resource.GetResourceValue("RecycleBinTitle"));
|
||||||
if (Frame.CanGoBack) Frame.GoBack();
|
Command.Execute(null);
|
||||||
}, null).GetAwaiter();
|
}, null).GetAwaiter();
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
using Windows.UI.Xaml;
|
using System.Windows.Input;
|
||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml;
|
||||||
using Microsoft.Xaml.Interactivity;
|
using Microsoft.Xaml.Interactivity;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Interfaces;
|
using ModernKeePass.Interfaces;
|
||||||
@@ -20,14 +20,14 @@ namespace ModernKeePass.Actions
|
|||||||
DependencyProperty.Register("Entity", typeof(IPwEntity), typeof(RestoreEntityAction),
|
DependencyProperty.Register("Entity", typeof(IPwEntity), typeof(RestoreEntityAction),
|
||||||
new PropertyMetadata(null));
|
new PropertyMetadata(null));
|
||||||
|
|
||||||
public Frame Frame
|
public ICommand Command
|
||||||
{
|
{
|
||||||
get { return (Frame)GetValue(FrameProperty); }
|
get { return (ICommand)GetValue(CommandProperty); }
|
||||||
set { SetValue(FrameProperty, value); }
|
set { SetValue(CommandProperty, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty FrameProperty =
|
public static readonly DependencyProperty CommandProperty =
|
||||||
DependencyProperty.Register("Frame", typeof(Frame), typeof(RestoreEntityAction),
|
DependencyProperty.Register("Command", typeof(ICommand), typeof(RestoreEntityAction),
|
||||||
new PropertyMetadata(null));
|
new PropertyMetadata(null));
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ namespace ModernKeePass.Actions
|
|||||||
|
|
||||||
ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityRestoredTitle"),
|
ToastNotificationHelper.ShowMovedToast(Entity, resource.GetResourceValue("EntityRestoredTitle"),
|
||||||
resource.GetResourceValue($"{type}Restored"));
|
resource.GetResourceValue($"{type}Restored"));
|
||||||
if (Frame.CanGoBack) Frame.GoBack();
|
Command.Execute(null);
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@@ -6,12 +6,12 @@
|
|||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<ResourceDictionary>
|
<ResourceDictionary>
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Styles/Colors.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/Colors.xaml" />
|
||||||
<ResourceDictionary Source="Styles/TextBoxWithButtonStyle.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/TextBoxWithButtonStyle.xaml" />
|
||||||
<ResourceDictionary Source="Styles/HamburgerButtonStyle.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/HamburgerButtonStyle.xaml" />
|
||||||
<ResourceDictionary Source="Styles/ListViewLeftIndicatorStyle.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/ListViewLeftIndicatorStyle.xaml" />
|
||||||
<ResourceDictionary Source="Styles/NoBorderButtonStyle.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/NoBorderButtonStyle.xaml" />
|
||||||
<ResourceDictionary Source="Styles/Styles.xaml" />
|
<ResourceDictionary Source="ResourceDictionaries/Styles.xaml" />
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
|
@@ -23,6 +23,7 @@ namespace ModernKeePass.Interfaces
|
|||||||
/// Restore ViewModel
|
/// Restore ViewModel
|
||||||
/// </summary>
|
/// </summary>
|
||||||
ICommand UndoDeleteCommand { get; }
|
ICommand UndoDeleteCommand { get; }
|
||||||
|
ICommand GoBackCommand { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Move a entity to the destination group
|
/// Move a entity to the destination group
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@@ -254,7 +254,7 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</ApplicationDefinition>
|
</ApplicationDefinition>
|
||||||
<Page Include="Styles\Colors.xaml">
|
<Page Include="ResourceDictionaries\Colors.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
@@ -331,27 +331,27 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Styles\HamburgerButtonStyle.xaml">
|
<Page Include="ResourceDictionaries\HamburgerButtonStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Styles\ListViewLeftIndicatorStyle.xaml">
|
<Page Include="ResourceDictionaries\ListViewLeftIndicatorStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Styles\NoBorderButtonStyle.xaml">
|
<Page Include="ResourceDictionaries\NoBorderButtonStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Styles\Styles.xaml">
|
<Page Include="ResourceDictionaries\Styles.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Styles\TextBoxWithButtonStyle.xaml">
|
<Page Include="ResourceDictionaries\TextBoxWithButtonStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
@@ -163,6 +163,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
public ICommand SaveCommand { get; }
|
public ICommand SaveCommand { get; }
|
||||||
public ICommand GeneratePasswordCommand { get; }
|
public ICommand GeneratePasswordCommand { get; }
|
||||||
public ICommand UndoDeleteCommand { get; }
|
public ICommand UndoDeleteCommand { get; }
|
||||||
|
public ICommand GoBackCommand { get; set; }
|
||||||
|
|
||||||
public event PropertyChangedEventHandler PropertyChanged;
|
public event PropertyChangedEventHandler PropertyChanged;
|
||||||
|
|
||||||
|
@@ -113,6 +113,7 @@ namespace ModernKeePass.ViewModels
|
|||||||
public ICommand SortEntriesCommand { get; }
|
public ICommand SortEntriesCommand { get; }
|
||||||
public ICommand SortGroupsCommand { get; }
|
public ICommand SortGroupsCommand { get; }
|
||||||
public ICommand UndoDeleteCommand { get; }
|
public ICommand UndoDeleteCommand { get; }
|
||||||
|
public ICommand GoBackCommand { get; set; }
|
||||||
|
|
||||||
private readonly PwGroup _pwGroup;
|
private readonly PwGroup _pwGroup;
|
||||||
private readonly IDatabaseService _database;
|
private readonly IDatabaseService _database;
|
||||||
|
@@ -273,44 +273,48 @@
|
|||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
Margin="{TemplateBinding BorderThickness}"
|
Margin="{TemplateBinding BorderThickness}"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"/>
|
||||||
Grid.RowSpan="1"/>
|
|
||||||
<Border x:Name="BorderElement"
|
<Border x:Name="BorderElement"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
Grid.ColumnSpan="3"/>
|
||||||
|
<ContentPresenter
|
||||||
|
x:Name="HeaderContentPresenter"
|
||||||
|
Grid.Row="0"
|
||||||
|
Grid.Column="0"
|
||||||
|
Foreground="{ThemeResource TextBoxForegroundHeaderThemeBrush}"
|
||||||
|
Margin="0,4,0,4"
|
||||||
Grid.ColumnSpan="3"
|
Grid.ColumnSpan="3"
|
||||||
Grid.RowSpan="1"/>
|
Content="{TemplateBinding Header}"
|
||||||
<ContentPresenter x:Name="HeaderContentPresenter"
|
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
||||||
Grid.Row="0"
|
FontWeight="Semilight" />
|
||||||
Foreground="{ThemeResource TextBoxForegroundHeaderThemeBrush}"
|
|
||||||
Margin="0,4,0,4"
|
|
||||||
Grid.ColumnSpan="3"
|
|
||||||
Content="{TemplateBinding Header}"
|
|
||||||
ContentTemplate="{TemplateBinding HeaderTemplate}"
|
|
||||||
FontWeight="Semilight" />
|
|
||||||
<ScrollViewer x:Name="ContentElement"
|
<ScrollViewer x:Name="ContentElement"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
Grid.Column="0"
|
||||||
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
HorizontalScrollMode="{TemplateBinding ScrollViewer.HorizontalScrollMode}"
|
||||||
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
|
||||||
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
VerticalScrollMode="{TemplateBinding ScrollViewer.VerticalScrollMode}"
|
||||||
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
|
||||||
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}"
|
||||||
Margin="{TemplateBinding BorderThickness}"
|
IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}"
|
||||||
Padding="{TemplateBinding Padding}"
|
Margin="{TemplateBinding BorderThickness}"
|
||||||
IsTabStop="False"
|
Padding="{TemplateBinding Padding}"
|
||||||
ZoomMode="Disabled"
|
IsTabStop="False"
|
||||||
AutomationProperties.AccessibilityView="Raw"/>
|
ZoomMode="Disabled"
|
||||||
<ContentControl x:Name="PlaceholderTextContentPresenter"
|
AutomationProperties.AccessibilityView="Raw"/>
|
||||||
Grid.Row="1"
|
<ContentControl
|
||||||
Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}"
|
x:Name="PlaceholderTextContentPresenter"
|
||||||
Margin="{TemplateBinding BorderThickness}"
|
Grid.Row="1"
|
||||||
Padding="{TemplateBinding Padding}"
|
Grid.Column="0"
|
||||||
IsTabStop="False"
|
Foreground="{ThemeResource TextBoxPlaceholderTextThemeBrush}"
|
||||||
Grid.ColumnSpan="3"
|
Margin="{TemplateBinding BorderThickness}"
|
||||||
Content="{TemplateBinding PlaceholderText}"
|
Padding="{TemplateBinding Padding}"
|
||||||
IsHitTestVisible="False"/>
|
IsTabStop="False"
|
||||||
|
Grid.ColumnSpan="3"
|
||||||
|
Content="{TemplateBinding PlaceholderText}"
|
||||||
|
IsHitTestVisible="False"/>
|
||||||
<Button x:Name="RevealButton"
|
<Button x:Name="RevealButton"
|
||||||
Grid.Row="1"
|
Grid.Row="1"
|
||||||
Style="{StaticResource RevealButtonStyle}"
|
Style="{StaticResource RevealButtonStyle}"
|
||||||
@@ -367,9 +371,9 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</Page.Resources>
|
</Page.Resources>
|
||||||
<Page.DataContext>
|
<!--<Page.DataContext>
|
||||||
<viewModels:EntryVm />
|
<viewModels:EntryVm />
|
||||||
</Page.DataContext>
|
</Page.DataContext>-->
|
||||||
<Page.BottomAppBar>
|
<Page.BottomAppBar>
|
||||||
<CommandBar x:Name="CommandBar" VerticalAlignment="Center">
|
<CommandBar x:Name="CommandBar" VerticalAlignment="Center">
|
||||||
<CommandBar.SecondaryCommands>
|
<CommandBar.SecondaryCommands>
|
||||||
@@ -380,7 +384,7 @@
|
|||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
<AppBarButton Icon="Save" x:Uid="AppBarSave" Command="{Binding SaveCommand}">
|
<AppBarButton Icon="Save" x:Uid="AppBarSave" Command="{Binding Path=SaveCommand}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
|
<core:ChangePropertyAction TargetObject="{Binding ElementName=CommandBar}" PropertyName="IsOpen" Value="False" />
|
||||||
@@ -405,14 +409,14 @@
|
|||||||
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Command="{Binding UndoDeleteCommand}">
|
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ParentGroup.IsSelected, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Command="{Binding UndoDeleteCommand}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<actions:RestoreEntityAction Entity="{Binding}" Frame="{Binding Frame, ElementName=PageRoot}" />
|
<actions:RestoreEntityAction Entity="{Binding}" Command="{Binding GoBackCommand}" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
<AppBarButton Icon="Delete" x:Uid="AppBarDelete">
|
<AppBarButton Icon="Delete" x:Uid="AppBarDelete">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<actions:DeleteEntityAction Entity="{Binding}" Frame="{Binding Frame, ElementName=PageRoot}" />
|
<actions:DeleteEntityAction Entity="{Binding}" Command="{Binding GoBackCommand}" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
using Windows.UI.Xaml.Controls;
|
using Windows.UI.Xaml.Controls;
|
||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Services;
|
|
||||||
using ModernKeePass.ViewModels;
|
using ModernKeePass.ViewModels;
|
||||||
|
|
||||||
// Pour en savoir plus sur le modèle d'élément Page Détail de l'élément, consultez la page http://go.microsoft.com/fwlink/?LinkId=234232
|
// Pour en savoir plus sur le modèle d'élément Page Détail de l'élément, consultez la page http://go.microsoft.com/fwlink/?LinkId=234232
|
||||||
@@ -45,6 +44,7 @@ namespace ModernKeePass.Views
|
|||||||
NavigationHelper.OnNavigatedTo(e);
|
NavigationHelper.OnNavigatedTo(e);
|
||||||
if (!(e.Parameter is EntryVm)) return;
|
if (!(e.Parameter is EntryVm)) return;
|
||||||
DataContext = (EntryVm)e.Parameter;
|
DataContext = (EntryVm)e.Parameter;
|
||||||
|
Model.GoBackCommand = NavigationHelper.GoBackCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||||
|
@@ -66,14 +66,14 @@
|
|||||||
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Command="{Binding UndoDeleteCommand}">
|
<AppBarButton Icon="Undo" x:Uid="AppBarRestore" Visibility="{Binding ShowRestore, Converter={StaticResource BooleanToVisibilityConverter}}" IsEnabled="{Binding PreviousGroup, Converter={StaticResource NullToBooleanConverter}}" Command="{Binding UndoDeleteCommand}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<actions:RestoreEntityAction Entity="{Binding}" Frame="{Binding Frame, ElementName=PageRoot}" />
|
<actions:RestoreEntityAction Entity="{Binding}" Command="{Binding GoBackCommand}" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
<AppBarButton Icon="Delete" x:Uid="AppBarDelete" IsEnabled="{Binding IsNotRoot}" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
|
<AppBarButton Icon="Delete" x:Uid="AppBarDelete" IsEnabled="{Binding IsNotRoot}" Visibility="{Binding IsSelected, Converter={StaticResource InverseBooleanToVisibilityConverter}}">
|
||||||
<interactivity:Interaction.Behaviors>
|
<interactivity:Interaction.Behaviors>
|
||||||
<core:EventTriggerBehavior EventName="Click">
|
<core:EventTriggerBehavior EventName="Click">
|
||||||
<actions:DeleteEntityAction Entity="{Binding}" Frame="{Binding Frame, ElementName=PageRoot}" />
|
<actions:DeleteEntityAction Entity="{Binding}" Command="{Binding GoBackCommand}" />
|
||||||
</core:EventTriggerBehavior>
|
</core:EventTriggerBehavior>
|
||||||
</interactivity:Interaction.Behaviors>
|
</interactivity:Interaction.Behaviors>
|
||||||
</AppBarButton>
|
</AppBarButton>
|
||||||
|
@@ -7,7 +7,6 @@ using Windows.UI.Xaml.Controls;
|
|||||||
using Windows.UI.Xaml.Navigation;
|
using Windows.UI.Xaml.Navigation;
|
||||||
using ModernKeePass.Common;
|
using ModernKeePass.Common;
|
||||||
using ModernKeePass.Events;
|
using ModernKeePass.Events;
|
||||||
using ModernKeePass.Services;
|
|
||||||
using ModernKeePass.ViewModels;
|
using ModernKeePass.ViewModels;
|
||||||
|
|
||||||
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
// The Group Detail Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234229
|
||||||
@@ -57,6 +56,7 @@ namespace ModernKeePass.Views
|
|||||||
if (vm != null)
|
if (vm != null)
|
||||||
DataContext = vm;
|
DataContext = vm;
|
||||||
}
|
}
|
||||||
|
Model.GoBackCommand = NavigationHelper.GoBackCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
protected override void OnNavigatedFrom(NavigationEventArgs e)
|
||||||
|
Reference in New Issue
Block a user