Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Create a grid, with columns and rows equal to the number of pin holes. Place empty columns/rows to account for empty columns/rows in the real device.</p> <p>In each grid cell add a grid. In the inner grids create a 3x3 row/column layout. For the first and last row/column, create * Gridlengths so you can adjust relative sizes between the buffer area and the middle cell.</p> <p>In the middle cell of the inner grids, add a rectangle with an ellipse using a drawing brush (so again, it stays relative).</p> <p>Here's XAML with the first row filled in.</p> <pre><code>&lt;Window x:Class="WpfApplication5.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="579" Width="274"&gt; &lt;Window.Resources&gt; &lt;Style TargetType="{x:Type UserControl}" x:Key="PinHole"&gt; &lt;Setter Property="Template"&gt; &lt;Setter.Value&gt; &lt;ControlTemplate&gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="1*"/&gt; &lt;ColumnDefinition Width="2*"/&gt; &lt;ColumnDefinition Width="1*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="1*"/&gt; &lt;RowDefinition Height="2*"/&gt; &lt;RowDefinition Height="1*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Rectangle Grid.Row="1" Grid.Column="1"&gt; &lt;Rectangle.Fill&gt; &lt;DrawingBrush&gt; &lt;DrawingBrush.Drawing&gt; &lt;GeometryDrawing Brush="Black"&gt; &lt;GeometryDrawing.Geometry&gt; &lt;GeometryGroup&gt; &lt;EllipseGeometry Center="1,1" RadiusX="1" RadiusY="1"/&gt; &lt;EllipseGeometry Center="1,1" RadiusX=".5" RadiusY=".5"/&gt; &lt;/GeometryGroup&gt; &lt;/GeometryDrawing.Geometry&gt; &lt;/GeometryDrawing&gt; &lt;/DrawingBrush.Drawing&gt; &lt;/DrawingBrush&gt; &lt;/Rectangle.Fill&gt; &lt;/Rectangle&gt; &lt;/Grid&gt; &lt;/ControlTemplate&gt; &lt;/Setter.Value&gt; &lt;/Setter&gt; &lt;/Style&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;ColumnDefinition/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;RowDefinition/&gt; &lt;/Grid.RowDefinitions&gt; &lt;UserControl Grid.Column="0" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="1" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="3" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="4" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="5" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="6" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="7" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="9" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="10" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="11" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="12" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="13" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="15" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;UserControl Grid.Column="16" Style="{StaticResource ResourceKey=PinHole}"/&gt; &lt;/Grid&gt; &lt;/Window&gt; </code></pre> <p>Now, when you add ICs, split them up into visual parts (top-left corner, etc), and arrange the parts in the right grid cell locations, together as a unit. </p> <p>In code, you can have an IC unit that you give a top-left cell to, and then the parts of the IC will set their Grid.Row and Grid.Column to the right locations.</p>
 

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