using Newtonsoft.Json;
namespace RuriLib.ViewModels
{
///
/// An observable wrapper around a Config object.
///
public class ConfigViewModel : ViewModelBase
{
/// The actual Config object.
public Config Config { get; set; }
private string category = "Default";
/// The Category of the config.
public string Category { get { return category; } set { category = value; OnPropertyChanged(); } }
private string path = "";
/// The path of the config file on disk.
public string Path { get { return path; } set { path = value; OnPropertyChanged(); } }
/// Whether the config was pulled from a remote source.
public bool Remote { get; set; } = false;
/// The name of the config.
public string Name { get { return Config.Settings.Name; } }
///
/// Constructs an instance of the ConfigViewModel class.
///
/// The path of the config file on disk
/// The category of the config
/// The actual Config object
/// Whether the Config was pulled from a remote source
public ConfigViewModel(string path, string category, Config config, bool remote = false)
{
Path = path;
Category = category;
Config = config;
Remote = remote;
}
}
}