private void fillList() { foreach (var item in NetworkEntitiesViewModel.DERs.ToList()) { DisplayDER displayDER = new DisplayDER(item); DisplayDERs.Add(displayDER); checkCanvas(displayDER); } UpdateCanvasOnViewChange(); }
private void OnFree(Canvas canvas) { if (canvas.Resources["taken"] != null) { DisplayDERs.Add(new DisplayDER(NetworkEntitiesViewModel.DERs.FirstOrDefault(x => x.Id == int.Parse(((TextBlock)(canvas).Children[1]).Text)))); canvas.Background = Brushes.Azure; canvas.Resources.Remove("taken"); ((TextBlock)(canvas).Children[0]).Text = "Slobodno mesto"; ((TextBlock)(canvas).Children[0]).Foreground = Brushes.Black; ((TextBlock)(canvas).Children[1]).Text = ""; ((TextBlock)(canvas).Children[1]).Foreground = Brushes.Transparent; } }