Added functionality to switch database

This commit is contained in:
Andre Beging
2017-09-11 11:52:20 +02:00
parent 3d2d4851cc
commit 68cd02e99b
4 changed files with 40 additions and 15 deletions

View File

@@ -8,6 +8,7 @@ using System.Linq;
using System.Windows;
using System;
using System.Configuration;
using System.Threading;
using SQLite.Net;
using SQLite.Net.Platform.Generic;
@@ -390,6 +391,32 @@ namespace DebtMgr.ViewModel
#endregion
#region SwitchDatabaseMenuCommand Command
/// <summary>
/// Private member backing variable for <see cref="SwitchDatabaseMenuCommand" />
/// </summary>
private RelayCommand _PrivateCommandName = null;
/// <summary>
/// Comment
/// </summary>
public RelayCommand SwitchDatabaseMenuCommand => _PrivateCommandName ?? (_PrivateCommandName = new RelayCommand(SwitchDatabaseMenuCommand_Execute));
private void SwitchDatabaseMenuCommand_Execute()
{
Properties.Settings.Default["Database"] = string.Empty;
Properties.Settings.Default.Save();
Thread.Sleep(100);
System.Diagnostics.Process.Start(Application.ResourceAssembly.Location);
Application.Current.Shutdown();
}
#endregion
////////////////////////////////////////////////////////////////////////////////////////////////////
/// <summary> Initializes a new instance of the MainViewModel class. </summary>
///