void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { var branch = JsonConvert.DeserializeObject<Branch>(e.Result); this.Dispatcher.BeginInvoke(() => { var mainBranch = branch.Embranchment.FirstOrDefault(); if (mainBranch == null) return; var unAllocateBranch = branch.Embranchment.Skip(1); var unAllocateStaff = branch.Staffs; orgChart = new OrgChart(mainBranch, unAllocateBranch, unAllocateStaff); orgChart.save.Click += new RoutedEventHandler(save_Click); this.activity.Content = orgChart; this.activity.IsActive = false; }); }
void wc_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { var branch = JsonConvert.DeserializeObject <Branch>(e.Result); this.Dispatcher.BeginInvoke(() => { var mainBranch = branch.Embranchment.FirstOrDefault(); if (mainBranch == null) { return; } var unAllocateBranch = branch.Embranchment.Skip(1); var unAllocateStaff = branch.Staffs; orgChart = new OrgChart(mainBranch, unAllocateBranch, unAllocateStaff); orgChart.save.Click += new RoutedEventHandler(save_Click); this.activity.Content = orgChart; this.activity.IsActive = false; }); }