From a57f1a7f8fb93f85737269b4b2f243773343deee Mon Sep 17 00:00:00 2001 From: Julian Date: Sun, 1 Mar 2020 16:07:22 +0100 Subject: [PATCH] Models added --- UWUVCI AIO WPF/Classes/Injection.cs | 2 +- UWUVCI AIO WPF/Models/BaseModel.cs | 25 +++++++++++++++++++++ UWUVCI AIO WPF/Models/MainViewModel.cs | 31 ++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 UWUVCI AIO WPF/Models/BaseModel.cs create mode 100644 UWUVCI AIO WPF/Models/MainViewModel.cs diff --git a/UWUVCI AIO WPF/Classes/Injection.cs b/UWUVCI AIO WPF/Classes/Injection.cs index 964d546..3bd52c9 100644 --- a/UWUVCI AIO WPF/Classes/Injection.cs +++ b/UWUVCI AIO WPF/Classes/Injection.cs @@ -310,7 +310,7 @@ namespace UWUVCI_AIO_WPF } else { - //DirectoryCopy(Path.Combine(Properties.Settings.Default.BaseRomPath, baserom), baseRomPath, true); + ///DirectoryCopy(Path.Combine(Properties.Settings.Default.BaseRomPath, baserom), baseRomPath, true); } } diff --git a/UWUVCI AIO WPF/Models/BaseModel.cs b/UWUVCI AIO WPF/Models/BaseModel.cs new file mode 100644 index 0000000..c49d9e1 --- /dev/null +++ b/UWUVCI AIO WPF/Models/BaseModel.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Runtime.CompilerServices; +using System.Text; + +namespace UWUVCI_AIO_WPF +{ + public class BaseModel : INotifyPropertyChanged + { + // Declare the PropertyChanged event + public event PropertyChangedEventHandler PropertyChanged; + + // OnPropertyChanged will raise the PropertyChanged event passing the + // source property that is being updated. + protected void OnPropertyChanged([CallerMemberName]string propertyName = "") + { + if (this.PropertyChanged != null) + { + PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); + } + } + } +} \ No newline at end of file diff --git a/UWUVCI AIO WPF/Models/MainViewModel.cs b/UWUVCI AIO WPF/Models/MainViewModel.cs new file mode 100644 index 0000000..da31b9d --- /dev/null +++ b/UWUVCI AIO WPF/Models/MainViewModel.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace UWUVCI_AIO_WPF +{ + class MainViewModel : BaseModel + { + //public GameConfig GameConfiguration { get; set; } + private GameConfig gameConfiguration; + + public GameConfig GameConfiguration + { + get { return gameConfiguration; } + set + { + gameConfiguration = value; + OnPropertyChanged(); + } + } + + public bool PathsSet { get; set; } = false; + + public MainViewModel() + { + GameConfiguration = new GameConfig(); + } + } +}