diff --git a/WeeXnes/App.xaml b/WeeXnes/App.xaml
index f2ab930..ba8bfd3 100644
--- a/WeeXnes/App.xaml
+++ b/WeeXnes/App.xaml
@@ -2,8 +2,38 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:WeeXnes"
- StartupUri="MainWindow.xaml">
+ xmlns:viewModel="clr-namespace:WeeXnes.MVVM.ViewModel"
+ xmlns:view="clr-namespace:WeeXnes.MVVM.View"
+ StartupUri="MainWindow.xaml"
+ Startup="App_OnStartup">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WeeXnes/App.xaml.cs b/WeeXnes/App.xaml.cs
index a1351fe..8ca5544 100644
--- a/WeeXnes/App.xaml.cs
+++ b/WeeXnes/App.xaml.cs
@@ -1,9 +1,29 @@
-namespace WeeXnes
+using System.Windows;
+using WeeXnes.Core;
+
+namespace WeeXnes
{
- ///
- /// Interaction logic for App.xaml
- ///
- public partial class App
- {
- }
-}
+ ///
+ /// Interaction logic for App.xaml
+ ///
+ public partial class App
+ {
+ private void App_OnStartup(object sender, StartupEventArgs e)
+ {
+ if (e.Args.Length > 0)
+ {
+ for (int i = 0; i != e.Args.Length; ++i)
+ {
+ //MessageBox.Show(e.Args[i]);
+ if (e.Args[i] == "-autostart")
+ {
+ //MessageBox.Show("Launched via autostart");
+ Globals.autoStartRpc = true;
+ }
+ }
+
+ }
+ //Globals.autoStartRpc = true;
+ }
+ }
+}
\ No newline at end of file
diff --git a/WeeXnes/Core/Globals.cs b/WeeXnes/Core/Globals.cs
new file mode 100644
index 0000000..9f59b3f
--- /dev/null
+++ b/WeeXnes/Core/Globals.cs
@@ -0,0 +1,56 @@
+using WeeXnes.RPC;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Nocksoft.IO.ConfigFiles;
+
+namespace WeeXnes.Core
+{
+ internal class Globals
+ {
+ public static string encryptionKey = "8zf5#RdyQ]$4x4_";
+ public static string AppDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "WeeXnes");
+ public static string KeyListPath = AppDataPath + "\\" + "Keys";
+ public static string RpcListPath = AppDataPath + "\\" + "RPC";
+ public static string SettingsFileName = "settings.ini";
+ public static string version = "2.3";
+ public static bool isRpcRunning = false;
+ public static string defaultRpcClient;
+ public static bool alwaysOnTop;
+ public static bool showElapsedTime;
+ public static bool copySelectedToClipboard;
+ public static bool autoStartRpc;
+
+
+ public static UpdateVar searchbox_content = new UpdateVar();
+ }
+ public static class funcs
+ {
+ public static bool IsDirectoryEmpty(string path)
+ {
+ return !Directory.EnumerateFileSystemEntries(path).Any();
+ }
+ }
+ public class UpdateVar
+ {
+ private T _value;
+
+ public Action ValueChanged;
+
+ public T Value
+ {
+ get => _value;
+
+ set
+ {
+ _value = value;
+ OnValueChanged();
+ }
+ }
+
+ protected virtual void OnValueChanged() => ValueChanged?.Invoke();
+ }
+}
diff --git a/WeeXnes/Core/ObservableObject.cs b/WeeXnes/Core/ObservableObject.cs
new file mode 100644
index 0000000..bac94be
--- /dev/null
+++ b/WeeXnes/Core/ObservableObject.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+
+namespace WeeXnes.Core
+{
+ internal class ObservableObject : INotifyPropertyChanged
+ {
+ public event PropertyChangedEventHandler PropertyChanged;
+ protected void OnPropertyChanged([CallerMemberName] string name = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
+ }
+ }
+}
diff --git a/WeeXnes/Core/RelayCommand.cs b/WeeXnes/Core/RelayCommand.cs
new file mode 100644
index 0000000..91b2324
--- /dev/null
+++ b/WeeXnes/Core/RelayCommand.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Windows.Input;
+
+namespace WeeXnes.Core
+{
+ internal class RelayCommand : ICommand
+ {
+ private Action