//Россия, Украина, Молдавия, Казахстан, Литва, Эстония public App() { InitializeComponent(); MainPage = new MainMasterDetailPage(); _codeStorageManager = ServiceLocator.Current.GetInstance <CodeStorageManager> (); _codeStorageManager.Init(); }
public HistoryViewModel() { _codeStorageManager = ServiceLocator.Current.GetInstance <CodeStorageManager> (); _historyList = new ObservableCollection <HistoryItem> (); foreach (var item in _codeStorageManager.Codes) { _historyList.Add(new HistoryItem { Code = item.Code, Status = item.Status, Command = CloseCommand }); } }
public MainScreenViewModel() { _storage = ServiceLocator.Current.GetInstance <IInternalStorage> (); if (Device.RuntimePlatform == Device.Android) { _inapp = ServiceLocator.Current.GetInstance <IInAppPurchase> (); } _codeManager = ServiceLocator.Current.GetInstance <CodeManager> (); _refreshManager = ServiceLocator.Current.GetInstance <RefreshManager> (); _codeStorageManager = ServiceLocator.Current.GetInstance <CodeStorageManager> (); _cityNames = new List <string> (Constants.CityList.Keys); var savedPin = _storage.RetrieveString(Constants.Pin); PIN = (string.IsNullOrEmpty(savedPin)) ? Constants.DefaultPin : savedPin; var savedCity = _storage.RetrieveString(Constants.City); SelectedCity = (string.IsNullOrEmpty(savedCity)) ? Constants.DefaultCity : savedCity; var savedProject = _storage.RetrieveString(Constants.Project); SelectedProject = (string.IsNullOrEmpty(savedProject)) ? Constants.DefaultProject : savedProject; var savedKey1 = _storage.RetrieveString(Constants.Key1); Prefix1 = (string.IsNullOrEmpty(savedKey1)) ? Keyboard._0_0_Text : savedKey1; var savedKey2 = _storage.RetrieveString(Constants.Key2); Prefix2 = (string.IsNullOrEmpty(savedKey2)) ? Keyboard._0_1_Text : savedKey2; var savedKey3 = _storage.RetrieveString(Constants.Key3); Prefix3 = (string.IsNullOrEmpty(savedKey3)) ? Keyboard._0_2_Text : savedKey3; var savedKey4 = _storage.RetrieveString(Constants.Key4); Prefix4 = (string.IsNullOrEmpty(savedKey4)) ? Keyboard._0_3_Text : savedKey4; var savedKey5 = _storage.RetrieveString(Constants.Key5); Prefix5 = (string.IsNullOrEmpty(savedKey5)) ? Keyboard._0_4_Text : savedKey5; Code = string.Empty; RefreshEnabled = true; _codeManager.ChangeCode += ChangeCode; _refreshManager.ScrollChanged += OnSrollChanged; _codeStorageManager.ConnectedChanged += ConnectedChanged; Paid = (Device.RuntimePlatform != Device.Android) || _storage.RetrieveBool(Constants.Paid); Load(); if (Device.RuntimePlatform == Device.Android) { LoadProducts(); } }