private async Task SavePersistedFlowState(StorageFile file, FlowStateForSerilization flowState) { string json = ""; try { json = JsonHelper.ToJson(flowState, KnownTypes); //json = JsonConvert.SerializeObject(flowState); } catch (Exception) { } await FileIO.WriteTextAsync(file, json); }
public async Task <FlowState> GetFlowState() { try { StorageFile file = await roamingFolder.GetFileAsync(fileName); string json = await FileIO.ReadTextAsync(file); //FlowStateForSerilization flowSate = JsonConvert.DeserializeObject<FlowStateForSerilization>(json, Settings); FlowStateForSerilization flowSate = JsonHelper.FromJson <FlowStateForSerilization>(json, KnownTypes); return(new FlowState(flowSate)); } catch (Exception) { return(null); } }