1 <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4 x:Class="Grid_Samp.Page1"
7 <TabControl MinHeight="500" MaxHeight="700" MinWidth="400">
8 <TabItem Style="{StaticResource TabStyle}" Header="Grid Element" IsSelected="true">
10 <TextBlock Style="{StaticResource HeaderStyle}">Grid Element Sample</TextBlock>
12 <TextBlock Style="{StaticResource mainContentStyle}">Grid defines a flexible grid area consisting of columns and rows. Child elements of a Grid can be positioned precisely using the Margin property.</TextBlock>
17 <TabItem Name="xaml" Style="{StaticResource TabStyle}" Header="XAML">
18 <ScrollViewer HorizontalScrollBarVisibility="Visible">
19 <TextBlock Name="xamlCheck">
20 <TextBox Style="{StaticResource CodeSnippetParagraph}" xml:space="preserve">
21 <Border BorderBrush="Black">
23 <Grid ShowGridLines="false" Background="White">
25 <Style TargetType="{x:Type ColumnDefinition}">
26 <Setter Property="ColumnDefinition.Width" Value="30"/>
28 <Style TargetType="{x:Type Rectangle}">
29 <Setter Property="Rectangle.RadiusX" Value="6"/>
30 <Setter Property="Rectangle.RadiusY" Value="6"/>
32 <Style x:Key="DayOfWeek">
33 <Setter Property="Grid.Row" Value="1"></Setter>
34 <Setter Property="TextBlock.Margin" Value="5"></Setter>
36 <Style x:Key="OneDate">
37 <Setter Property="TextBlock.Margin" Value="5"></Setter>
40 <Grid.ColumnDefinitions>
41 <ColumnDefinition/>
42 <ColumnDefinition/>
43 <ColumnDefinition/>
44 <ColumnDefinition/>
45 <ColumnDefinition/>
46 <ColumnDefinition/>
47 <ColumnDefinition/>
48 <ColumnDefinition Width="*"/>
49 <!-- This column will receive all remaining width -->
50 </Grid.ColumnDefinitions>
51 <Grid.RowDefinitions>
52 <RowDefinition Height="Auto"/>
53 <RowDefinition Height="Auto"/>
54 <RowDefinition Height="Auto"/>
55 <RowDefinition Height="Auto"/>
56 <RowDefinition Height="Auto"/>
57 <RowDefinition Height="Auto"/>
58 <RowDefinition Height="Auto"/>
60 <!-- This row will receive all remaining Height -->
61 </Grid.RowDefinitions>
63 <!-- These Rectangles constitute the backgrounds of the various Rows and Columns -->
66 <Rectangle Grid.ColumnSpan="7" Fill="#73B2F5"/>
67 <Rectangle Grid.Row="1" Grid.RowSpan="6" Fill="#73B2F5"/>
68 <Rectangle Grid.Column="6" Grid.Row="1" Grid.RowSpan="6" Fill="#73B2F5"/>
69 <Rectangle Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5" Grid.RowSpan="6"
73 <TextBlock Grid.ColumnSpan="7" Margin="0,5,0,5" HorizontalAlignment="Center">
74 January 2004</TextBlock>
76 <!-- Draws a separator under the days-of-the-week row -->
78 <Rectangle Grid.Row="1" Grid.ColumnSpan="7"
79 Fill="Black" RadiusX="1" RadiusY="1" Height="2" Margin="0,20,0,0"/>
81 <!-- Day-of-the-week row -->
82 <TextBlock Grid.Column="0" Style="{StaticResource DayOfWeek}">Sun</TextBlock>
83 <TextBlock Grid.Column="1" Style="{StaticResource DayOfWeek}">Mon</TextBlock>
84 <TextBlock Grid.Column="2" Style="{StaticResource DayOfWeek}">Tue</TextBlock>
85 <TextBlock Grid.Column="3" Style="{StaticResource DayOfWeek}">Wed</TextBlock>
86 <TextBlock Grid.Column="4" Style="{StaticResource DayOfWeek}">Thu</TextBlock>
87 <TextBlock Grid.Column="5" Style="{StaticResource DayOfWeek}">Fri</TextBlock>
88 <TextBlock Grid.Column="6" Style="{StaticResource DayOfWeek}">Sat</TextBlock>
90 <!-- Dates go here -->
91 <TextBlock Grid.Column="4" Grid.Row="2" Style="{StaticResource OneDate}">1</TextBlock>
92 <TextBlock Grid.Column="5" Grid.Row="2" Style="{StaticResource OneDate}">2</TextBlock>
93 <TextBlock Grid.Column="6" Grid.Row="2" Style="{StaticResource OneDate}">3</TextBlock>
94 <TextBlock Grid.Column="0" Grid.Row="3" Style="{StaticResource OneDate}">4</TextBlock>
95 <TextBlock Grid.Column="1" Grid.Row="3" Style="{StaticResource OneDate}">5</TextBlock>
96 <TextBlock Grid.Column="2" Grid.Row="3" Style="{StaticResource OneDate}">6</TextBlock>
97 <TextBlock Grid.Column="3" Grid.Row="3" Style="{StaticResource OneDate}">7</TextBlock>
98 <TextBlock Grid.Column="4" Grid.Row="3" Style="{StaticResource OneDate}">8</TextBlock>
99 <TextBlock Grid.Column="5" Grid.Row="3" Style="{StaticResource OneDate}">9</TextBlock>
100 <TextBlock Grid.Column="6" Grid.Row="3" Style="{StaticResource OneDate}">10</TextBlock>
101 <TextBlock Grid.Column="0" Grid.Row="4" Style="{StaticResource OneDate}">11</TextBlock>
102 <TextBlock Grid.Column="1" Grid.Row="4" Style="{StaticResource OneDate}">12</TextBlock>
103 <TextBlock Grid.Column="2" Grid.Row="4" Style="{StaticResource OneDate}">13</TextBlock>
104 <TextBlock Grid.Column="3" Grid.Row="4" Style="{StaticResource OneDate}">14</TextBlock>
105 <TextBlock Grid.Column="4" Grid.Row="4" Style="{StaticResource OneDate}">15</TextBlock>
106 <TextBlock Grid.Column="5" Grid.Row="4" Style="{StaticResource OneDate}">16</TextBlock>
107 <TextBlock Grid.Column="6" Grid.Row="4" Style="{StaticResource OneDate}">17</TextBlock>
108 <TextBlock Grid.Column="0" Grid.Row="5" Style="{StaticResource OneDate}">18</TextBlock>
109 <TextBlock Grid.Column="1" Grid.Row="5" Style="{StaticResource OneDate}">19</TextBlock>
110 <TextBlock Grid.Column="2" Grid.Row="5" Style="{StaticResource OneDate}">20</TextBlock>
111 <TextBlock Grid.Column="3" Grid.Row="5" Style="{StaticResource OneDate}">21</TextBlock>
112 <TextBlock Grid.Column="4" Grid.Row="5" Style="{StaticResource OneDate}">22</TextBlock>
113 <TextBlock Grid.Column="5" Grid.Row="5" Style="{StaticResource OneDate}">23</TextBlock>
114 <TextBlock Grid.Column="6" Grid.Row="5" Style="{StaticResource OneDate}">24</TextBlock>
115 <TextBlock Grid.Column="0" Grid.Row="6" Style="{StaticResource OneDate}">25</TextBlock>
116 <TextBlock Grid.Column="1" Grid.Row="6" Style="{StaticResource OneDate}">26</TextBlock>
117 <TextBlock Grid.Column="2" Grid.Row="6" Style="{StaticResource OneDate}">27</TextBlock>
118 <TextBlock Grid.Column="3" Grid.Row="6" Style="{StaticResource OneDate}">28</TextBlock>
119 <TextBlock Grid.Column="4" Grid.Row="6" Style="{StaticResource OneDate}">29</TextBlock>
120 <TextBlock Grid.Column="5" Grid.Row="6" Style="{StaticResource OneDate}">30</TextBlock>
121 <TextBlock Grid.Column="6" Grid.Row="6" Style="{StaticResource OneDate}">31</TextBlock>
128 <TabItem Name="xamlcsharp" Style="{StaticResource TabStyle}" Header="XAML + C#">
129 <TabControl TabStripPlacement="Right">
130 <TabItem Name="xcsharpCheck" Style="{StaticResource TabStyle2}" Header="XAML"></TabItem>
131 <TabItem Style="{StaticResource TabStyle2}" Header="C#"></TabItem>
135 <TabItem Name="xamlvb" Style="{StaticResource TabStyle}" Header="XAML + Visual Basic.NET">
136 <TabControl TabStripPlacement="Right">
137 <TabItem Name="xvbCheck" Style="{StaticResource TabStyle2}" Header="XAML"></TabItem>
138 <TabItem Style="{StaticResource TabStyle2}" Header="VB.NET"></TabItem>
142 <TabItem Name="csharp" Style="{StaticResource TabStyle}" Header="C#"></TabItem>
144 <TabItem Name="vb" Style="{StaticResource TabStyle}" Header="Visual Basic.NET"></TabItem>
146 <TabItem Name="managedcpp" Style="{StaticResource TabStyle}" Header="Managed C++"></TabItem>
148 <TabItem Style="{StaticResource TabStyle}" Header="Preview Sample">
149 <Border BorderBrush="Black">
151 <Grid ShowGridLines="false" Background="White">
153 <Style TargetType="{x:Type ColumnDefinition}">
154 <Setter Property="ColumnDefinition.Width" Value="30"/>
156 <Style TargetType="{x:Type Rectangle}">
157 <Setter Property="Rectangle.RadiusX" Value="6"/>
158 <Setter Property="Rectangle.RadiusY" Value="6"/>
160 <Style x:Key="DayOfWeek">
161 <Setter Property="Grid.Row" Value="1"></Setter>
162 <Setter Property="TextBlock.Margin" Value="5"></Setter>
164 <Style x:Key="OneDate">
165 <Setter Property="TextBlock.Margin" Value="5"></Setter>
168 <Grid.ColumnDefinitions>
176 <ColumnDefinition Width="*"/>
177 <!-- This column will receive all remaining width -->
178 </Grid.ColumnDefinitions>
179 <Grid.RowDefinitions>
180 <RowDefinition Height="Auto"/>
181 <RowDefinition Height="Auto"/>
182 <RowDefinition Height="Auto"/>
183 <RowDefinition Height="Auto"/>
184 <RowDefinition Height="Auto"/>
185 <RowDefinition Height="Auto"/>
186 <RowDefinition Height="Auto"/>
188 <!-- This row will receive all remaining Height -->
189 </Grid.RowDefinitions>
190 <!-- These Rectangles constitute the backgrounds of the various Rows and Columns -->
193 <Rectangle Grid.ColumnSpan="7" Fill="#73B2F5"/>
194 <Rectangle Grid.Row="1" Grid.RowSpan="6" Fill="#73B2F5"/>
195 <Rectangle Grid.Column="6" Grid.Row="1" Grid.RowSpan="6" Fill="#73B2F5"/>
196 <Rectangle Grid.Column="1" Grid.Row="1" Grid.ColumnSpan="5" Grid.RowSpan="6"
200 <TextBlock Grid.ColumnSpan="7" Margin="0,5,0,5" HorizontalAlignment="Center">
201 January 2004</TextBlock>
203 <!-- Draws a separator under the days-of-the-week row -->
205 <Rectangle Grid.Row="1" Grid.ColumnSpan="7"
206 Fill="Black" RadiusX="1" RadiusY="1" Height="2" Margin="0,20,0,0"/>
208 <!-- Day-of-the-week row -->
209 <TextBlock Grid.Column="0" Style="{StaticResource DayOfWeek}">Sun</TextBlock>
210 <TextBlock Grid.Column="1" Style="{StaticResource DayOfWeek}">Mon</TextBlock>
211 <TextBlock Grid.Column="2" Style="{StaticResource DayOfWeek}">Tue</TextBlock>
212 <TextBlock Grid.Column="3" Style="{StaticResource DayOfWeek}">Wed</TextBlock>
213 <TextBlock Grid.Column="4" Style="{StaticResource DayOfWeek}">Thu</TextBlock>
214 <TextBlock Grid.Column="5" Style="{StaticResource DayOfWeek}">Fri</TextBlock>
215 <TextBlock Grid.Column="6" Style="{StaticResource DayOfWeek}">Sat</TextBlock>
217 <!-- Dates go here -->
218 <TextBlock Grid.Column="4" Grid.Row="2" Style="{StaticResource OneDate}">1</TextBlock>
219 <TextBlock Grid.Column="5" Grid.Row="2" Style="{StaticResource OneDate}">2</TextBlock>
220 <TextBlock Grid.Column="6" Grid.Row="2" Style="{StaticResource OneDate}">3</TextBlock>
221 <TextBlock Grid.Column="0" Grid.Row="3" Style="{StaticResource OneDate}">4</TextBlock>
222 <TextBlock Grid.Column="1" Grid.Row="3" Style="{StaticResource OneDate}">5</TextBlock>
223 <TextBlock Grid.Column="2" Grid.Row="3" Style="{StaticResource OneDate}">6</TextBlock>
224 <TextBlock Grid.Column="3" Grid.Row="3" Style="{StaticResource OneDate}">7</TextBlock>
225 <TextBlock Grid.Column="4" Grid.Row="3" Style="{StaticResource OneDate}">8</TextBlock>
226 <TextBlock Grid.Column="5" Grid.Row="3" Style="{StaticResource OneDate}">9</TextBlock>
227 <TextBlock Grid.Column="6" Grid.Row="3" Style="{StaticResource OneDate}">10</TextBlock>
228 <TextBlock Grid.Column="0" Grid.Row="4" Style="{StaticResource OneDate}">11</TextBlock>
229 <TextBlock Grid.Column="1" Grid.Row="4" Style="{StaticResource OneDate}">12</TextBlock>
230 <TextBlock Grid.Column="2" Grid.Row="4" Style="{StaticResource OneDate}">13</TextBlock>
231 <TextBlock Grid.Column="3" Grid.Row="4" Style="{StaticResource OneDate}">14</TextBlock>
232 <TextBlock Grid.Column="4" Grid.Row="4" Style="{StaticResource OneDate}">15</TextBlock>
233 <TextBlock Grid.Column="5" Grid.Row="4" Style="{StaticResource OneDate}">16</TextBlock>
234 <TextBlock Grid.Column="6" Grid.Row="4" Style="{StaticResource OneDate}">17</TextBlock>
235 <TextBlock Grid.Column="0" Grid.Row="5" Style="{StaticResource OneDate}">18</TextBlock>
236 <TextBlock Grid.Column="1" Grid.Row="5" Style="{StaticResource OneDate}">19</TextBlock>
237 <TextBlock Grid.Column="2" Grid.Row="5" Style="{StaticResource OneDate}">20</TextBlock>
238 <TextBlock Grid.Column="3" Grid.Row="5" Style="{StaticResource OneDate}">21</TextBlock>
239 <TextBlock Grid.Column="4" Grid.Row="5" Style="{StaticResource OneDate}">22</TextBlock>
240 <TextBlock Grid.Column="5" Grid.Row="5" Style="{StaticResource OneDate}">23</TextBlock>
241 <TextBlock Grid.Column="6" Grid.Row="5" Style="{StaticResource OneDate}">24</TextBlock>
242 <TextBlock Grid.Column="0" Grid.Row="6" Style="{StaticResource OneDate}">25</TextBlock>
243 <TextBlock Grid.Column="1" Grid.Row="6" Style="{StaticResource OneDate}">26</TextBlock>
244 <TextBlock Grid.Column="2" Grid.Row="6" Style="{StaticResource OneDate}">27</TextBlock>
245 <TextBlock Grid.Column="3" Grid.Row="6" Style="{StaticResource OneDate}">28</TextBlock>
246 <TextBlock Grid.Column="4" Grid.Row="6" Style="{StaticResource OneDate}">29</TextBlock>
247 <TextBlock Grid.Column="5" Grid.Row="6" Style="{StaticResource OneDate}">30</TextBlock>
248 <TextBlock Grid.Column="6" Grid.Row="6" Style="{StaticResource OneDate}">31</TextBlock>