title: WPF: Display polyline and points simultaneously
body: <p>I have a list of line segments and each line segment contains a list of points. Being contained on the same canvas, I want to display each line segment and simultaneously mark each point location (ie w/ an ellipse). I can use an ItemsControl to display the segments but I'm stuck at how to display the points. I began implementing a custom control derived from Shape, but there must be an easier way. Thanks in advance for the help.</p>
  
  <pre><code>public class VesselAnatomy : IEnumerable, INotifyCollectionChanged
  {
  ...
  List&lt;BaseVessel&gt; _Segments;
  ...
  }
  
  public class BaseVessel : INotifyPropertyChanged
  {
  ...
  ObservableCollection&lt;Point&gt; _VesselPoints;
  public ObservableCollection&lt;Point&gt; VesselPoints
          {
              get
              {
                  return _VesselPoints;
              }
          }
  ...
  }
  
  public MainWindow()
  {
  ...
  VesselAnatomy Vessels = new VesselAnatomy();
  ...
  MasterContainer.DataContext =  Vessels;
  ...
  }
  
  &lt;ItemsControl x:Name="VesselDisplay"
                            Height="750"
                            Width="750"
                        ItemsSource="{Binding}"&gt;
                          &lt;Polyline Points="{Binding VesselPoints, Converter={StaticResource ObsListPointConverter}}"
                              Stroke="Red"
                              StrokeThickness="7"&gt;
                              &lt;Polyline.ToolTip&gt;
                                  &lt;ToolTip&gt;
                                      &lt;TextBlock Text="{Binding Name}"/&gt;
                                  &lt;/ToolTip&gt;
                              &lt;/Polyline.ToolTip&gt;
                          &lt;/Polyline&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ItemsControl.ItemTemplate&gt;
              &lt;/ItemsControl&gt;
  </code></pre>