mirror of
https://github.com/wismna/ModernKeePass.git
synced 2025-10-03 15:40:18 -04:00
Creation of a notification service
This commit is contained in:
@@ -41,6 +41,7 @@ namespace ModernKeePass
|
||||
private readonly INavigationService _navigation;
|
||||
private readonly IHockeyClient _hockey;
|
||||
private readonly IDialogService _dialog;
|
||||
private readonly INotificationService _notification;
|
||||
|
||||
public static IServiceProvider Services { get; private set; }
|
||||
|
||||
@@ -64,6 +65,7 @@ namespace ModernKeePass
|
||||
_settings = Services.GetService<ISettingsProxy>();
|
||||
_navigation = Services.GetService<INavigationService>();
|
||||
_dialog = Services.GetService<IDialogService>();
|
||||
_notification = Services.GetService<INotificationService>();
|
||||
_hockey = Services.GetService<IHockeyClient>();
|
||||
|
||||
InitializeComponent();
|
||||
@@ -181,14 +183,14 @@ namespace ModernKeePass
|
||||
{
|
||||
await _mediator.Send(new ReOpenDatabaseQuery());
|
||||
#if DEBUG
|
||||
ToastNotificationHelper.ShowGenericToast("App resumed", "Database reopened (changes were saved)");
|
||||
_notification.Show("App resumed", "Database reopened (changes were saved)");
|
||||
#endif
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
currentFrame?.Navigate(typeof(MainPage));
|
||||
#if DEBUG
|
||||
ToastNotificationHelper.ShowGenericToast("App resumed", "Nothing to do, no previous database opened");
|
||||
_notification.Show("App resumed", "Nothing to do, no previous database opened");
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -229,7 +231,7 @@ namespace ModernKeePass
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
ToastNotificationHelper.ShowErrorToast(exception);
|
||||
_notification.Show(exception.Source, exception.Message);
|
||||
}
|
||||
finally
|
||||
{
|
||||
|
@@ -133,7 +133,7 @@
|
||||
<value>Opening...</value>
|
||||
</data>
|
||||
<data name="CompositeKeyUpdated" xml:space="preserve">
|
||||
<value>Database composite key updated.</value>
|
||||
<value>Database credentials updated.</value>
|
||||
</data>
|
||||
<data name="EntityDeleteActionButton" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
|
@@ -133,7 +133,7 @@
|
||||
<value>Ouverture...</value>
|
||||
</data>
|
||||
<data name="CompositeKeyUpdated" xml:space="preserve">
|
||||
<value>Clé composite de la base de données mise à jour.</value>
|
||||
<value>Identifiants de la base de données mis à jour.</value>
|
||||
</data>
|
||||
<data name="EntityDeleteActionButton" xml:space="preserve">
|
||||
<value>Supprimer</value>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
<converters:DoubleToSolidColorBrushConverter x:Key="DoubleToSolidColorBrushConverter"/>
|
||||
<converters:DiscreteIntToSolidColorBrushConverter x:Key="DiscreteIntToSolidColorBrushConverter"/>
|
||||
<converters:EmptyStringToVisibilityConverter x:Key="EmptyStringToVisibilityConverter"/>
|
||||
<viewModels:SetCredentialsViewModel x:Key="ViewModel"/>
|
||||
<viewModels:SetCredentialsVm x:Key="ViewModel"/>
|
||||
</UserControl.Resources>
|
||||
<Grid DataContext="{StaticResource ViewModel}">
|
||||
<Grid.ColumnDefinitions>
|
||||
|
@@ -11,7 +11,7 @@ namespace ModernKeePass.Views.UserControls
|
||||
{
|
||||
public sealed partial class SetCredentialsUserControl
|
||||
{
|
||||
private SetCredentialsViewModel Model => (SetCredentialsViewModel)Resources["ViewModel"];
|
||||
private SetCredentialsVm Model => (SetCredentialsVm)Resources["ViewModel"];
|
||||
|
||||
public string ButtonLabel
|
||||
{
|
||||
|
Reference in New Issue
Block a user