void Initialize() { BacklogItem1 = new BacklogItem(); BacklogItem2 = new BacklogItem(); BacklogItem3 = new BacklogItem(); if (!File.Exists(filePath)) CreateDefaultFile(); Update(); }
void Initialize() { BacklogItem1 = new BacklogItem(); BacklogItem2 = new BacklogItem(); BacklogItem3 = new BacklogItem(); if (!File.Exists(filePath)) { CreateDefaultFile(); } Update(); }
void Update(BacklogItem backlogItem) { if (backlogItem == null) return; if(!Dispatcher.CheckAccess()) { Dispatcher.Invoke(() => Update(backlogItem)); return; } if (!string.IsNullOrEmpty(backlogItem.Title)) UserStoryText.Text = backlogItem.Title; if (!string.IsNullOrEmpty(backlogItem.Status)) StatusText.Text = backlogItem.Status; if (!string.IsNullOrEmpty(backlogItem.StatusColor)) StatusText.Background = new BrushConverter().ConvertFrom(backlogItem.StatusColor) as SolidColorBrush; }
private void ReadFromFile() { var jsonString = File.ReadAllText(filePath); var jObject = JObject.Parse(jsonString); var jBacklogItems = jObject["BacklogItems"].Values<string>().ToList(); BacklogItem1 = JsonConvert.DeserializeObject<BacklogItem>(jBacklogItems[0]); BacklogItem2 = JsonConvert.DeserializeObject<BacklogItem>(jBacklogItems[1]); BacklogItem3 = JsonConvert.DeserializeObject<BacklogItem>(jBacklogItems[2]); }