title: Bind Polygon.Points using a IMultiValueConverter?
body: <p>I have successfully bound a Polygon's Points using a IValueConverter.
  Now I need to use a IMultiValueConverter.</p>
  
  <p>Let me outline what I am trying to accomplish first, if anyone sees a better way, tell me!
  I can use .NET 4.5 fyi.</p>
  
  <p>I have a data store with a bunch of objects in it.
  These objects do not have any type of Point/PointCollection associated with it.
  I am able to create Points based on properties of the object in the data store, if I have the parents Height.  Without the Height I can't generate points.</p>
  
  <p>I currently have a working implementation, but I preform all the Point calculations in code.
  This leads to performance issues because I have to re-calculate all objects every time the parents Height changes.</p>
  
  <p>On to the code:</p>
  
  <pre><code>&lt;Window
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:Converters="clr-namespace:Converters"
      x:Class="MainWindow"
      Title="MainWindow" Height="611" Width="525"&gt;
  &lt;Window.Resources&gt;
      &lt;Converters:PointsConverter x:Key="PointsConverter" /&gt;
  &lt;/Window.Resources&gt;
  &lt;Grid&gt;
      &lt;Slider x:Name="slider" HorizontalAlignment="Left" Margin="344,10,0,0" VerticalAlignment="Top" Width="114" Value="1" Minimum="0.1" Maximum="4"/&gt;
      &lt;ScrollViewer x:Name="TimelineScroller" ClipToBounds="True" VerticalScrollBarVisibility="Disabled" 
                                 Focusable="False" HorizontalScrollBarVisibility="Visible" 
                                 Visibility="Visible" Margin="50,93,35,206"&gt;
  
          &lt;Grid ClipToBounds="True"&gt;
              &lt;Grid.RowDefinitions&gt;
                  &lt;RowDefinition Height="30"/&gt;
                  &lt;RowDefinition Height="1*"/&gt;
              &lt;/Grid.RowDefinitions&gt;
  
              &lt;ItemsControl x:Name="TopItemControl" Grid.Row="1" ItemsSource="{Binding TopData}"&gt;
                  &lt;ItemsControl.ItemsPanel&gt;
                      &lt;ItemsPanelTemplate&gt;
                          &lt;Canvas x:Name="TopAxis" Background="#FF65656C" Grid.Row="1" RenderTransformOrigin="0.5,0.5"&gt;
                              &lt;Canvas.RenderTransform&gt;
                                  &lt;TransformGroup&gt;
                                      &lt;ScaleTransform ScaleX="{Binding Value, ElementName=slider}"/&gt;
                                      &lt;SkewTransform/&gt;
                                      &lt;RotateTransform/&gt;
                                      &lt;TranslateTransform/&gt;
                                  &lt;/TransformGroup&gt;
                              &lt;/Canvas.RenderTransform&gt;
                          &lt;/Canvas&gt;
                      &lt;/ItemsPanelTemplate&gt;
                  &lt;/ItemsControl.ItemsPanel&gt;
                  &lt;ItemsControl.ItemTemplate&gt;
                      &lt;DataTemplate&gt;
                          &lt;ContentControl &gt;
                              &lt;Polygon x:Name="polygon" Stroke="Black"  RenderTransformOrigin="0.5,0.5"&gt;
                                  &lt;Polygon.RenderTransform&gt;
                                      &lt;TransformGroup&gt;
                                          &lt;ScaleTransform ScaleX="{Binding Value, ElementName=slider}"/&gt;
                                          &lt;SkewTransform/&gt;
                                          &lt;RotateTransform/&gt;
                                          &lt;TranslateTransform/&gt;
                                      &lt;/TransformGroup&gt;
                                  &lt;/Polygon.RenderTransform&gt;
                                  &lt;Polygon.Points&gt;
                                      &lt;MultiBinding Converter="{StaticResource PointsConverter}"&gt;
                                          &lt;Binding ElementName="TopAxis" Path="ActualHeight"/&gt;
                                          &lt;Binding /&gt;
                                      &lt;/MultiBinding&gt;
                                  &lt;/Polygon.Points&gt;
                              &lt;/Polygon&gt;
                          &lt;/ContentControl&gt;
                      &lt;/DataTemplate&gt;
                  &lt;/ItemsControl.ItemTemplate&gt;
              &lt;/ItemsControl&gt;
          &lt;/Grid&gt;
      &lt;/ScrollViewer&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>And my dumb converter code:</p>
  
  <pre><code>    public class PointsConverter : IMultiValueConverter
  {
      public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
      {
          //simple string for testing
          return "10,255 500,255 500,200 400,150 200,150 10,200";
      }
  
      public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) { throw new NotImplementedException(); }
  }
  </code></pre>
  
  <p>BTW, here is the error I am getting:</p>
  
  <pre><code>System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='10,255 500,255 500,200 400,150 200,150 10,200' MultiBindingExpression:target element is 'Polygon' (Name='polygon'); target property is 'Points' (type 'PointCollection')
  </code></pre>