I have a grid and three columns. Here goes the code:
<Grid x:Name="StaticGrid"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Width="450"
Margin="3">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{TemplateBinding Description}"
Grid.Column="0"
Height="30"
HorizontalAlignment="Left"/>
<TextBlock Text="......................................................................................................"
Grid.Column="1"/>
<TextBlock Text="{TemplateBinding ParamValue}"
Grid.Column="2"
Height="30"
HorizontalAlignment="Right"/>
</Grid>
So if my grid has a fixed size then this solution is ok, but if it changes dynamically then I don't know how to change the periods dynamically.
I have read this post, but the solution given by Bob Bao is not working in Silverlight
(I mean the DrawingBrush
object is not supported).
I have also read this post, where Tamir Khason offers to clone the WPF
object to use it in Silverlight
. I don't want to use such complex solutions.
Does anyone have a better solution?