aurora/Aurora/Design/Views/Profile/ProfileViewModel.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2019-07-05 18:17:09 +00:00
using System;
2020-02-01 01:41:45 +00:00
using Aurora.Services.Settings;
2019-07-05 18:17:09 +00:00
namespace Aurora.Design.Views.Profile
{
public class ProfileViewModel : BaseViewModel
{
2020-02-01 01:41:45 +00:00
private ISettingsService _settingsService;
2019-07-05 18:17:09 +00:00
2020-02-01 01:41:45 +00:00
public ProfileViewModel(ISettingsService settingsService)
2019-07-05 18:17:09 +00:00
{
2020-02-01 01:41:45 +00:00
this._settingsService = settingsService;
2019-07-05 18:17:09 +00:00
}
public string Username
{
2020-02-01 01:41:45 +00:00
get { return this._settingsService.Username; }
2019-07-05 18:17:09 +00:00
set
{
2020-02-01 01:41:45 +00:00
this._settingsService.Username = value;
2019-07-05 18:17:09 +00:00
OnPropertyChanged("Username");
}
}
2019-07-06 19:52:28 +00:00
public string Port
{
2020-02-01 01:41:45 +00:00
get { return this._settingsService.DefaultPort.ToString(); }
2019-07-06 19:52:28 +00:00
set
{
Int32.TryParse(value, out int portNum);
2020-02-01 01:41:45 +00:00
this._settingsService.DefaultPort = portNum;
2019-07-06 19:52:28 +00:00
OnPropertyChanged("Port");
}
}
public string LibraryPath
{
get { return this._settingsService.LibraryLocation; }
set
{
this._settingsService.LibraryLocation = value;
OnPropertyChanged("LibraryPath");
}
}
2019-07-05 18:17:09 +00:00
}
}