Models added

This commit is contained in:
Julian 2020-03-01 16:07:22 +01:00
parent 55137c10b1
commit a57f1a7f8f
3 changed files with 57 additions and 1 deletions

View file

@ -310,7 +310,7 @@ namespace UWUVCI_AIO_WPF
} }
else else
{ {
//DirectoryCopy(Path.Combine(Properties.Settings.Default.BaseRomPath, baserom), baseRomPath, true); ///DirectoryCopy(Path.Combine(Properties.Settings.Default.BaseRomPath, baserom), baseRomPath, true);
} }
} }

View file

@ -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));
}
}
}
}

View file

@ -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();
}
}
}