Table border and Avalon resources


So, do you want your table cell borders to be visible? Try the new and improved Resources, now available on all participating elements!
 
Note that you can scope this at different levels - anywhere where Resources are available.
 
<Window x:Class="VancouverApp.Window1"
 xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
 xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
 Text="My Other Vancouver App"
 >
<Window.Resources>
 <Style TargetType='{x:Type TableCell}'>
  <Setter Property='Background' Value='VerticalGradient SkyBlue LightBlue' />
  <Setter Property='BorderBrush' Value='DarkBlue' />
  <Setter Property='BorderThickness' Value='1' />
 </Style>
</Window.Resources>
 
<TextFlow FontSize='32'>
 <Paragraph>Check this out:</Paragraph>
 <Table><TableBody>
  <TableRow>
   <TableCell><Paragraph>I have a border!</Paragraph></TableCell>
   <TableCell><Paragraph>And so do I.</Paragraph></TableCell>
   <TableCell><Paragraph>And so...</Paragraph>
    <Paragraph>... does the cell...</Paragraph>
    <Paragraph>... for these paragraphs.</Paragraph></TableCell>
  </TableRow><TableRow>
   <TableCell ColumnSpan='3'><Paragraph>And so does this long cell.</Paragraph></TableCell>
  </TableRow>
 </TableBody></Table>
</TextFlow>
</Window>


And yes, I know, I also added a background to the cells. It's just that it's so easy to do so in Avalon, I couldn't help myself...



 


This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm.


Comments (0)

Skip to main content