Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Regarding the concentric circle case, combining Clemens's solution with a converter allows for precisely sized circles whose width can be changed dynamically and the amount of circles is set to as many will fit in the allowed area.</p> <pre><code>class SizeSpacingToCircleGroupConverter : IMultiValueConverter { public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture) { if (values == null) return values; var input = values.OfType&lt;double&gt;().ToArray(); if (input.Length != 3) return values; var width = input[0]; var height = input[1]; var spacing = input[2]; var halfSpacing = spacing / 2; var diameter = width &gt; height ? height : width; var lineCount = (int)Math.Floor((diameter / (2 * spacing)) - 1); if (lineCount &lt;= 0) return values; var circles = Enumerable.Range(0, lineCount).Select(i =&gt; { var radius = halfSpacing + (i * spacing); return new EllipseGeometry() { RadiusX = radius, RadiusY = radius }; }).ToArray(); var group = new GeometryGroup(); foreach (var circle in circles) group.Children.Add(circle); return group; } public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture) { throw new NotImplementedException(); } } </code></pre> <p>And the XAML:</p> <pre><code>&lt;Rectangle Height="{StaticResource Diameter}" Width="{StaticResource Diameter}"&gt; &lt;Rectangle.Fill&gt; &lt;DrawingBrush Stretch="None"&gt; &lt;DrawingBrush.Drawing&gt; &lt;GeometryDrawing&gt; &lt;GeometryDrawing.Pen&gt; &lt;Pen Brush="{StaticResource ForegroundBrush}" Thickness="{StaticResource SpacingDiv2}"/&gt; &lt;/GeometryDrawing.Pen&gt; &lt;GeometryDrawing.Geometry&gt; &lt;MultiBinding Converter="{StaticResource SizeSpacingToCircleGroupConverter}"&gt; &lt;Binding Source="{StaticResource Diameter}" /&gt; &lt;Binding Source="{StaticResource Diameter}" /&gt; &lt;Binding Source="{StaticResource Spacing}" /&gt; &lt;/MultiBinding&gt; &lt;/GeometryDrawing.Geometry&gt; &lt;/GeometryDrawing&gt; &lt;/DrawingBrush.Drawing&gt; &lt;/DrawingBrush&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; </code></pre> <p>In my case I'm just using doubles defined in my resource dictionary but I could easily use a binding from a view model.</p> <p>I still won't mark anything as the accepted answer however because the question was about a tiled radial sweep which could be useful for other reasons.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload