Added functionality to switch database
This commit is contained in:
@@ -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>
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user