protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            IStorageFile file = await ApplicationData.Current.LocalFolder.GetFileAsync(CredentialsFileName, true);

            string credentialsJson = await file.ReadTextAsync();

            App.API.Credentials = credentialsJson.IsNullOrWhiteSpace()
                ? null
                : JsonConvert.DeserializeObject <MSACredentials>(credentialsJson);

            this.UpdateButtonStates();
        }
Example #2
0
        public static async Task <T> GetDataAsync <T>(this IStorageFile storageFile)
        {
            var dataString = await storageFile.ReadTextAsync();

            return(SerializationService.Json.Deserialize <T>(dataString));
        }