public PracticeViewModel(JsonValue json, IJsonContext ctx) { var dict = JsonDictionary.FromValue(json); items = ctx.FromJson <List <PracticeItem> >(dict["items"]); nextItems = ctx.FromJson <List <PracticeItem> >(dict["nextItems"]); failed = ctx.FromJson <bool>(dict["failed"]); currentItem = ctx.FromJson <PracticeItem>(dict["currentItem"]); currentIndex = ctx.FromJson <int>(dict["currentIndex"]); itemCount = ctx.FromJson <int>(dict["itemCount"]); score = ctx.FromJson <int>(dict["score"]); round = ctx.FromJson <int>(dict["round"]); lastRoundInfo = ctx.FromJson <RoundInfo>(dict["lastRoundInfo"]); allRounds = new ObservableCollection <RoundInfo>(ctx.FromJson <List <RoundInfo> >(dict["allRounds"])); maxItemCount = ctx.FromJson <int>(dict["maxItemCount"]); title = ctx.FromJson <string>(dict["title"]); }
public PracticeViewModel(JsonValue json, IJsonContext ctx) { var dict = JsonDictionary.FromValue(json); items = ctx.FromJson<List<PracticeItem>>(dict["items"]); nextItems = ctx.FromJson<List<PracticeItem>>(dict["nextItems"]); failed = ctx.FromJson<bool>(dict["failed"]); currentItem = ctx.FromJson<PracticeItem>(dict["currentItem"]); currentIndex = ctx.FromJson<int>(dict["currentIndex"]); itemCount = ctx.FromJson<int>(dict["itemCount"]); score = ctx.FromJson<int>(dict["score"]); round = ctx.FromJson<int>(dict["round"]); lastRoundInfo = ctx.FromJson<RoundInfo>(dict["lastRoundInfo"]); allRounds = new ObservableCollection<RoundInfo>(ctx.FromJson<List<RoundInfo>>(dict["allRounds"])); maxItemCount = ctx.FromJson<int>(dict["maxItemCount"]); title = ctx.FromJson<string>(dict["title"]); }
void AddRoundInfo() { allRounds.Add(LastRoundInfo = new RoundInfo(allRounds.Count + 1, Score, ItemCount)); }