36 lines
928 B
C#
36 lines
928 B
C#
using System;
|
|
using Xamarin.Forms;
|
|
|
|
namespace Aurora.Backend.Services
|
|
{
|
|
public class SettingsService : BaseService<SettingsService>
|
|
{
|
|
private string _usernameKey = "Username";
|
|
|
|
public SettingsService()
|
|
{
|
|
}
|
|
|
|
public string Username
|
|
{
|
|
get
|
|
{
|
|
if (!Application.Current.Properties.ContainsKey(_usernameKey))
|
|
{
|
|
return "";
|
|
}
|
|
|
|
Application.Current.Properties.TryGetValue(_usernameKey, out object val);
|
|
return val as string;
|
|
}
|
|
set
|
|
{
|
|
if (Application.Current.Properties.ContainsKey(_usernameKey))
|
|
{
|
|
Application.Current.Properties.Remove(_usernameKey);
|
|
}
|
|
Application.Current.Properties.Add(_usernameKey, value);
|
|
}
|
|
}
|
|
}
|
|
} |