title: Drawing WPF Polygon with a stroke in solid color or transparent around
body: <p>I need to create a generic triangle in WPF indicating coordinates, stroke and colors for stroke and filling area. The problem is that i want indicate as color also the Transparent for stroke, meaning than using the same coordinate, I want to draw, all inside this shape, a transparent stroke that replace for his thickness the fill color, but it seems not be possible (I found and solved with a triky the same problem for Circle and Rectangle shapes, but with Polygon it doesn't work: <a href="https://stackoverflow.com/questions/55709909/drawing-a-wpf-shape-as-a-rectangle-strokethickness-halve-if-stroke-is-transpar">Drawing a WPF shape, as a Rectangle: StrokeThickness halve if Stroke is Transparent</a> ). 
  The code I use now include a clip because the stroke grow part inside and part outside the coordinate profile, I need to remove outside part, and some converter to give array of points in the correct way:</p>
  
  <pre><code>&lt;UserControl.Clip&gt;
      &lt;PathGeometry&gt;
          &lt;PathFigure StartPoint="{Binding Triangle.Points, Converter={StaticResource PointLocationClipConverter}}" IsClosed="True"&gt;
              &lt;PolyLineSegment Points="{Binding Triangle.Points, Converter={StaticResource PointCollectionClipConverter}}" /&gt;
          &lt;/PathFigure&gt;
      &lt;/PathGeometry&gt;
  &lt;/UserControl.Clip&gt;
  
  &lt;Grid x:Name="_grid"&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
  
      &lt;Polygon Points="{Binding Triangle.Points, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource PointCollectionConverter}}" Grid.Row="0" Grid.Column="0" Margin="0,0,0,0"
               Width="{Binding ActualWidth, ElementName=_grid}"
               Height="{Binding ActualHeight, ElementName=_grid}"
               Stroke="{Binding Triangle.BorderColorBrush}"
               StrokeThickness="{Binding Triangle.Thick, Converter={StaticResource PoligonThickConverter}}" 
               Fill="{Binding Triangle.BackgroundBrush}" /&gt;
  
  &lt;/Grid&gt;
  </code></pre>
  
  <p>What I have at this moment is:</p>
  
  <p><a href="https://i.stack.imgur.com/U0kBH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/U0kBH.png" alt="current result"></a></p>
  
  <p>what I want instead is:</p>
  
  <p><a href="https://i.stack.imgur.com/qexmu.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qexmu.png" alt="wanted result"></a></p>
  
  <p>notice: for both example posted, the first image has solid color for Stroke and Fill area, second image has Transparent on Stroke and solid color for Fill area (and here is the problem), third image  has solid color for Stroke and Transparent for Fill area. All images have same coordinates and StrokeThickness value.</p>
  
  <p>Thanks for help!</p>