Microscopic Traffic Simulator

- Main Page
- Packages
- Classes
- Files

- File List

TopologyCanvas.cs
Go to the documentation of this file.
1 using System.Collections.Generic;
2 using System.Windows.Controls;
3 using System.Windows.Media;
4
5 namespace Microscopic_Traffic_Simulator.Views.MainWindowView
6 {
10 class TopologyCanvas : Canvas
11 {
16 private List<DrawingVisual> visuals = new List<DrawingVisual>();
17
21 protected override int VisualChildrenCount
22 {
23 get
24 {
25 return visuals.Count;
26 }
27 }
28
34 protected override Visual GetVisualChild(int index)
35 {
36 return visuals[index];
37 }
38
43 internal DrawingVisual CreateNewVisual()
44 {
45 DrawingVisual newVisual = new DrawingVisual();
46 visuals.Add(newVisual);
47 AddVisualChild(newVisual);
48 return newVisual;
49 }
50 }
51 }
System
Microscopic_Traffic_Simulator.Views.MainWindowView.TopologyCanvas.GetVisualChild
override Visual GetVisualChild(int index)
Get visual from visuals list.
Definition: TopologyCanvas.cs:34
Microscopic_Traffic_Simulator.Views.MainWindowView.TopologyCanvas
Class representing topology canvas.
Definition: TopologyCanvas.cs:10
Microscopic_Traffic_Simulator
Definition: App.xaml.cs:12