Note that there are some explanatory texts on larger screens.

plurals
  1. POWPF Style Setter * Height and Width
    text
    copied!<p>I'm trying to create a WPF application which consists of a 9x9 grid with the row and columns using different styles. What I'm hoping to do is provide a star value for the height and width of the column and row definitions. This does not appear to work in the current context. Is this even possible, and if so, how?</p> <pre><code>&lt;Window x:Class="BaroqueChessUI.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="500" Width="500"&gt; &lt;Window.Resources&gt; &lt;Style x:Key="LightBackground" &gt; &lt;Setter Property="Control.Background" Value="Teal" /&gt; &lt;/Style&gt; &lt;Style x:Key="DarkBackground" &gt; &lt;Setter Property="Control.Background" Value="Maroon" /&gt; &lt;/Style&gt; &lt;Style x:Key="FileStyle"&gt; &lt;Setter Property="Control.Width" Value="0.12" /&gt; &lt;/Style&gt; &lt;Style x:Key="RankStyle"&gt; &lt;Setter Property="Control.Height" Value="0.12" /&gt; &lt;/Style&gt; &lt;Style x:Key="FileHeadingStyle"&gt; &lt;Setter Property="Control.Width" Value="0.04" /&gt; &lt;/Style&gt; &lt;Style x:Key="RankHeadingStyle"&gt; &lt;Setter Property="Control.Height" Value="0.04" /&gt; &lt;/Style&gt; &lt;/Window.Resources&gt; &lt;Grid&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Name="rdRank" Style="{StaticResource FileHeadingStyle}" /&gt; &lt;RowDefinition Name="rdRank1" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank2" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank3" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank4" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank5" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank6" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank7" Style="{StaticResource FileStyle}" /&gt; &lt;RowDefinition Name="rdRank8" Style="{StaticResource FileStyle}" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Name="cdFile" Style="{StaticResource RankHeadingStyle}" /&gt; &lt;ColumnDefinition Name="cdFile2" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile3" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile4" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile5" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile6" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile7" Style="{StaticResource RankStyle}" /&gt; &lt;ColumnDefinition Name="cdFile8" Style="{StaticResource RankStyle}" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;/Grid&gt; </code></pre> <p></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