2012-09-17 63 views
0

我已經創建了XAML,具有網格結構,3行或4行,每行包含兩列,如果我想爲每行和每行的邊界線設置顏色,專欄,我該如何實現它。關於XAML中的UICreation的問題Windows Phone 7

我是新來這個UI的創建XAML中尤其是,Anyidea關於如何實現這一目標將useful`

    <TextBlock Foreground="Black" Text="Account Number :" Margin="10" Grid.ColumnSpan="2" /> 
        <TextBlock Foreground="Black" x:Name="accNO" Text="" Grid.Column="2" Margin="10"/> 

        <TextBlock Foreground="Black" Text="Currency :" Grid.Row="1" Margin="10" Grid.ColumnSpan="2" /> 
        <TextBlock Foreground="Black" x:Name="accCurr" Text="" Grid.Row="1" Grid.Column="2" Margin="10"/> 
        <TextBlock Foreground="Black" Text="Acount Balance :" Grid.Row="2" Margin="10" Grid.ColumnSpan="2" /> 
        <TextBlock Foreground="Black" x:Name="accOBal" Text="" Grid.Row="2" Grid.Column="2" Margin="10"/> 
        <TextBlock Foreground="Black" Text="Available Balance :" Grid.Row="3" Margin="10" Grid.ColumnSpan="2" /> 
        <TextBlock Foreground="Black" x:Name="avBal" Text="" Grid.Row="3" Grid.Column="2" Margin="10"/> 

       </Grid>` 

我已經更新代碼按照我的要求獲取桌子

<Border Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" BorderThickness="1" BorderBrush="White"> 
         <Border.Background> 
          <LinearGradientBrush EndPoint="1,0" StartPoint="1,1"> 
           <GradientStop Color="LightGray" Offset="0" /> 
           <GradientStop Color="LightGray" Offset="1" /> 
          </LinearGradientBrush>       
         </Border.Background> 
         <TextBlock Foreground="Black" Text="Account Number :" Margin="10" Grid.ColumnSpan="2" /> 
        </Border> 

        <Border Grid.Row="0" Grid.Column="2" BorderThickness="1" BorderBrush="White"> 
         <TextBlock Foreground="Black" x:Name="accNO" Text="" Grid.Column="2" Margin="10"/> 
        </Border> 

感謝help.It是爲網格的第一行完成。

回答

2

如果你想周圍的每一行和每一列的邊框,然後將每行每列

<Border Grid.Row="2" Grid.Column="1" BorderThickness="1" BorderBrush="White"> 
    <TextBlock Text="This is some text." /> 
</Border> 
+0

是否有任何屬性設置爲每一行和每一列的背景顏色內邊框元素? – Rakesh

+0

對於整行和整列,或者對於每一行/列組合? –

+0

嗨,我想獲得一些背景顏色整行0和行2和行1和3其他背景顏色。 – Rakesh