added samples
[windows-sources.git] / sdk / samples / WPFSamples / EditingCommands_Sample / csharp / window1.xaml
blob03b5a2233bccca93e2570f7f827cdf36fffc5a1d
1 <Window 
2   x:Class="SDKSample.Window1"
3   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"    
5   Title="EditingCommands_Sample"
6   Width="1024" Height="800"
8     <Grid>
9       <Grid.RowDefinitions>
10         <RowDefinition Height="40"/>
11         <RowDefinition/>
12         <RowDefinition/>
13         <RowDefinition Height="80"/>
14       </Grid.RowDefinitions>
15       <Grid.ColumnDefinitions>
16         <ColumnDefinition Width="200"/>
17         <ColumnDefinition Width="200"/>
18         <ColumnDefinition/>
19       </Grid.ColumnDefinitions>
21       <Border
22         Grid.Row="0" Grid.Column="2"
23         BorderBrush="Black" BorderThickness="1"
24         Margin="5"
25       >
26         <StackPanel
27           Orientation="Horizontal"
28           VerticalAlignment="Center" HorizontalAlignment="Center"
29         >
30           <TextBlock
31             Margin="5" Foreground="DarkGreen"
32           >
33             <Bold>Route editing commands to:</Bold>
34           </TextBlock>
35           <RadioButton
36             Name="routeToRTB"
37             Margin="5"
38             IsChecked="True" 
39             Content=" RichTextBox"
40           />
41           <RadioButton
42             Name="routeToTB"  
43             Margin="5"
44             Content=" TextBox"
45           />
46           <RadioButton
47             Name="routeToPWB"  
48             Margin="5"
49             Content=" PasswordBox"
50           />
51         </StackPanel>
52       </Border>
54       <Border 
55         Grid.Column="0" Grid.RowSpan="4" 
56         BorderBrush="Black" BorderThickness="1"
57       >
58         <StackPanel 
59           VerticalAlignment="Center"
60           Margin="10"
61         >
62           <TextBlock
63             Foreground="DarkGreen"
64           >
65             <Bold>Paragraph Alignment</Bold>
66           </TextBlock>
68           <Button Name="AlignCenter" Click="ExecuteCommand">
69             AlignCenter (Ctrl+E)
70           </Button>
71           <Button Name="AlignRight" Click="ExecuteCommand">
72             AlignRight (Ctrl+R)
73           </Button>
74           <Button Name="AlignLeft" Click="ExecuteCommand">
75             AlignLeft (Ctrl+L)
76           </Button>
77           <Button Name="AlignJustify" Click="ExecuteCommand">
78             AlignJustify (Ctrl+J)
79           </Button>
81           <TextBlock
82             Foreground="DarkGreen"
83           >
84             <Bold>Paragraph Formatting</Bold>
85           </TextBlock>
86           <Button Name="IncreaseIndentation" Click="ExecuteCommand">
87             IncreaseIndentation (Ctrl+T)
88           </Button>
89           <Button Name="DecreaseIndentation" Click="ExecuteCommand">
90             DecreaseIndentation (Ctrl+Shift+T)
91           </Button>
92           <Button Name="ToggleBullets" Click="ExecuteCommand">
93             ToggleBullets (Ctrl+Shift+L)
94           </Button>
95           <Button Name="ToggleNumbering" Click="ExecuteCommand">
96             ToggleNumbering (Ctrl+Shift+N)
97           </Button>
99           <TextBlock
100             Foreground="DarkGreen"
101           >
102             <Bold>Caret Movement By Line</Bold>
103           </TextBlock>
104           <Button Name="MoveUpByLine" Click="ExecuteCommand">
105             MoveUpByLine (Up)
106           </Button>
107           <Button Name="MoveDownByLine" Click="ExecuteCommand">
108             MoveDownByLine (Down)
109           </Button>
110           <Button Name="MoveToLineStart" Click="ExecuteCommand">
111             MoveToLineStart (Home)
112           </Button>
113           <Button Name="MoveToLineEnd" Click="ExecuteCommand">
114             MoveToLineEnd (End)
115           </Button>
117           <TextBlock
118             Foreground="DarkGreen"
119           >
120             <Bold>Caret Movement By Character</Bold>
121           </TextBlock>
122           <Button Name="MoveLeftByCharacter" Click="ExecuteCommand">
123             MoveLeftByCharacter (Left)
124           </Button>
125           <Button Name="MoveRightByCharacter" Click="ExecuteCommand">
126             MoveRightByCharacter (Right)
127           </Button>
129           <TextBlock
130             Foreground="DarkGreen"
131           >
132             <Bold>Caret Movement By Word</Bold>
133           </TextBlock>
134           <Button Name="MoveLeftByWord" Click="ExecuteCommand">
135             MoveLeftByWord (Ctrl+Left)
136           </Button>
137           <Button Name="MoveRightByWord" Click="ExecuteCommand">
138             MoveRightByWord (Ctrl+Right)
139           </Button>
141           <TextBlock
142             Foreground="DarkGreen"
143           >
144             <Bold>Caret Movement By Paragraph</Bold>
145           </TextBlock>
146           <Button Name="MoveUpByParagraph" Click="ExecuteCommand">
147             MoveUpByParagraph (Ctrl+Up)
148           </Button>
149           <Button Name="MoveDownByParagraph" Click="ExecuteCommand">
150             MoveDownByParagraph (Ctrl+Down)
151           </Button>
153           <TextBlock
154             Foreground="DarkGreen"
155           >
156             <Bold>Caret Movement By Page</Bold>
157           </TextBlock>
158           <Button Name="MoveUpByPage" Click="ExecuteCommand">
159             MoveUpByPage (PageUp)
160           </Button>
161           <Button Name="MoveDownByPage" Click="ExecuteCommand">
162             MoveDownByPage (PageDown)
163           </Button>
165           <TextBlock
166             Foreground="DarkGreen"
167           >
168             <Bold>Caret Movement By Document</Bold>
169           </TextBlock>
170           <Button Name="MoveToDocumentStart" Click="ExecuteCommand">
171             MoveToDocumentStart (Ctrl+Home)
172           </Button>
173           <Button Name="MoveToDocumentEnd" Click="ExecuteCommand">
174             MoveToDocumentEnd (Ctrl+End)
175           </Button>
177           <TextBlock
178             Foreground="DarkGreen"
179           >
180             <Bold>Deletion</Bold>
181           </TextBlock>
182           <Button Name="Delete" Click="ExecuteCommand">
183             Delete (Delete)
184           </Button>
185           <Button Name="DeleteNextWord" Click="ExecuteCommand">
186             DeleteNextWord (Ctrl+Delete)
187           </Button>
188           <Button Name="DeletePreviousWord" Click="ExecuteCommand">
189             DeletePreviousWord (Ctrl+Backspace)
190           </Button>
192           <TextBlock
193             Foreground="DarkGreen"
194           >
195             <Bold>Toggle Insert</Bold>
196           </TextBlock>
197           <Button Name="ToggleInsert" Click="ExecuteCommand">
198             ToggleInsert (Insert)
199           </Button>
201         </StackPanel>
202       </Border>
204       <Border 
205         Grid.Column="1" Grid.RowSpan="4" 
206         BorderBrush="Black" BorderThickness="1"
207       >
208         <StackPanel 
209           VerticalAlignment="Center"
210           Margin="10"
211         >
212           <TextBlock
213             Foreground="DarkGreen"
214           >
215             <Bold>Symbol Entry</Bold>
216           </TextBlock>
217           <Button Name="Backspace" Click="ExecuteCommand">
218             Backspace (Backspace)
219           </Button>
220           <Button Name="EnterLineBreak" Click="ExecuteCommand">
221             EnterLineBreak (Shift+Enter)
222           </Button>
223           <Button Name="EnterParagraphBreak" Click="ExecuteCommand">
224             EnterParagraphBreak (Enter)
225           </Button>
226           <Button Name="TabBackward" Click="ExecuteCommand">
227             TabBackward (Shift+Tab)
228           </Button>
229           <Button Name="TabForward" Click="ExecuteCommand">
230             TabForward (Tab)
231           </Button>
233           <TextBlock
234             Foreground="DarkGreen"
235           >
236             <Bold>Formatting</Bold>
237           </TextBlock>
238           <Button Name="IncreaseFontSize" Click="ExecuteCommand">
239             IncreaseFontSize (Ctrl+])
240           </Button>
241           <Button Name="DecreaseFontSize" Click="ExecuteCommand">
242             DecreaseFontSize (Ctrl+[)
243           </Button>
244           <Button Name="ToggleBold" Click="ExecuteCommand">
245             ToggleBold (Ctrl+B)
246           </Button>
247           <Button Name="ToggleItalic" Click="ExecuteCommand">
248             ToggleItalic (Ctrl+I)
249           </Button>
250           <Button Name="ToggleSubscript" Click="ExecuteCommand">
251             ToggleSubscript (Ctrl+Shift+Plus)
252           </Button>
253           <Button Name="ToggleSuperscript" Click="ExecuteCommand">
254             ToggleSuperscript (Ctrl+Plus)
255           </Button>
256           <Button Name="ToggleUnderline" Click="ExecuteCommand">
257             ToggleUnderline (Ctrl+U)
258           </Button>
260           <TextBlock
261             Foreground="DarkGreen"
262           >
263             <Bold>Caret Selection By Line</Bold>
264           </TextBlock>
265           <Button Name="SelectUpByLine" Click="ExecuteCommand">
266             SelectUpByLine (Up)
267           </Button>
268           <Button Name="SelectDownByLine" Click="ExecuteCommand">
269             SelectDownByLine (Down)
270           </Button>
271           <Button Name="SelectToLineStart" Click="ExecuteCommand">
272             SelectToLineStart (Home)
273           </Button>
274           <Button Name="SelectToLineEnd" Click="ExecuteCommand">
275             SelectToLineEnd (End)
276           </Button>
278           <TextBlock
279             Foreground="DarkGreen"
280           >
281             <Bold>Caret Selection By Character</Bold>
282           </TextBlock>
283           <Button Name="SelectLeftByCharacter" Click="ExecuteCommand">
284             SelectLeftByCharacter (Left)
285           </Button>
286           <Button Name="SelectRightByCharacter" Click="ExecuteCommand">
287             SelectRightByCharacter (Right)
288           </Button>
290           <TextBlock
291             Foreground="DarkGreen"
292           >
293             <Bold>Caret Selection By Word</Bold>
294           </TextBlock>
295           <Button Name="SelectLeftByWord" Click="ExecuteCommand">
296             SelectLeftByWord (Ctrl+Left)
297           </Button>
298           <Button Name="SelectRightByWord" Click="ExecuteCommand">
299             SelectRightByWord (Ctrl+Right)
300           </Button>
302           <TextBlock
303             Foreground="DarkGreen"
304           >
305             <Bold>Caret Selection By Paragraph</Bold>
306           </TextBlock>
307           <Button Name="SelectUpByParagraph" Click="ExecuteCommand">
308             SelectUpByParagraph (Ctrl+Up)
309           </Button>
310           <Button Name="SelectDownByParagraph" Click="ExecuteCommand">
311             SelectDownByParagraph (Ctrl+Down)
312           </Button>
314           <TextBlock
315             Foreground="DarkGreen"
316           >
317             <Bold>Caret Selection By Page</Bold>
318           </TextBlock>
319           <Button Name="SelectUpByPage" Click="ExecuteCommand">
320             SelectUpByPage (PageUp)
321           </Button>
322           <Button Name="SelectDownByPage" Click="ExecuteCommand">
323             SelectDownByPage (PageDown)
324           </Button>
326           <TextBlock
327             Foreground="DarkGreen"
328           >
329             <Bold>Caret Selection By Document</Bold>
330           </TextBlock>
331           <Button Name="SelectToDocumentStart" Click="ExecuteCommand">
332             SelectToDocumentStart (Ctrl+Home)
333           </Button>
334           <Button Name="SelectToDocumentEnd" Click="ExecuteCommand">
335             SelectToDocumentEnd (Ctrl+End)
336           </Button>
338         </StackPanel>
339       </Border>
341       <Border Grid.Row="1" Grid.Column="2">
342         <StackPanel>
343           <TextBlock
344             Margin="5"
345             Foreground="DarkGreen"
346           >
347             <Bold>RichTextBox with sample content.</Bold>
348           </TextBlock>
349           <RichTextBox
350             Name="sampleRTB"
351             Margin="5" Background="Ivory"
352             AcceptsTab="True"
353           >
354             <FlowDocument>
355               <Paragraph>
356                 <Bold>Xbox 360: Feel the Power</Bold>
357               </Paragraph>
358               <Paragraph>
359                 We all know that Xbox 360™ blows the doors off today's consoles in the power department. But just how much power
360                 does Xbox 360 have, and why do developers and gamers agree that it's the system to beat? Glad you asked!
361               </Paragraph>
362               <Paragraph>
363                 By now you've already heard how Xbox 360 puts you at the center of the most powerful games on the planet—hence
364                 the "360," as in 360 degrees (geometry students will recognize that as the number of degrees in a circle).
365                 To accomplish this feat, Microsoft® has brought together a full circle of powerful factors.
366               </Paragraph>
367               <Paragraph>
368                 <Bold>Processing Powerhouse</Bold>
369               </Paragraph>
370               <Paragraph>
371                 The custom-designed Xbox 360 central processing unit (CPU) runs at a breakneck speed, thanks to its three
372                 separate core processors that clock in at 3.2 GHz each.
373               </Paragraph>
374               <Paragraph>
375                 Xbox 360 boasts a custom ATI graphics processor that clocks in at a blistering 500 MHz. If you want to get
376                 even more technical (and who doesn't?) Xbox 360 can take advantage of more than four times as many polygons
377                 as the original Xbox® console, and more than four times (seeing a pattern here?) the number of pixels per second.
378               </Paragraph>
379               <Paragraph>
380                 The 512 MB of RAM in Xbox 360 is eight times more powerful than the original Xbox, in terms of simple arithmetic.
381                 The system RAM gives developers a unified memory architecture. Game creators decide how to partition it, and all
382                 of the hardware components (like the CPU and GPU) can access the memory...
383               </Paragraph>
384             </FlowDocument>
385           </RichTextBox>
386           </StackPanel>
387         </Border>
389       <Border Grid.Row="2" Grid.Column="2">
390         <StackPanel>
391           <TextBlock
392             Margin="5"
393             Foreground="DarkGreen"
394           >
395             <Bold>TextBox with sample content.</Bold>
396           </TextBlock>
397           <TextBox
398             Name="sampleTB"    
399             AcceptsReturn="True"
400             AcceptsTab="True"
401             xml:space="preserve"
402             Margin="5" Background="Ivory"
403           >Xbox 360: Feel the Power
405 We all know that Xbox 360™ blows the doors off today's consoles in the power department. But just how much
406 power does Xbox 360 have, and why do developers and gamers agree that it's the system to beat? Glad you asked!
408 By now you've already heard how Xbox 360 puts you at the center of the most powerful games on the planet—hence
409 the "360," as in 360 degrees (geometry students will recognize that as the number of degrees in a circle). To
410 accomplish this feat, Microsoft® has brought together a full circle of powerful factors.
412 Processing Powerhouse
414 The custom-designed Xbox 360 central processing unit (CPU) runs at a breakneck speed, thanks to its three separate
415 core processors that clock in at 3.2 GHz each.
417 Xbox 360 boasts a custom ATI graphics processor that clocks in at a blistering 500 MHz. If you want to get even 
418 more technical (and who doesn't?) Xbox 360 can take advantage of more than four times as many polygons as the 
419 original Xbox® console, and more than four times (seeing a pattern here?) the number of pixels per second.
421 The 512 MB of RAM in Xbox 360 is eight times more powerful than the original Xbox, in terms of simple arithmetic.
422 The system RAM gives developers a unified memory architecture. Game creators decide how to partition it, and all of
423 the hardware components (like the CPU and GPU) can access the memory...</TextBox>
424         </StackPanel>
425       </Border>
427       <Border Grid.Row="3" Grid.Column="2">
428         <StackPanel>
429           <TextBlock
430             Margin="5"
431             Foreground="DarkGreen"
432           >
433             <Bold>PasswordBox with sample content.</Bold>
434           </TextBlock>
435           <PasswordBox
436             Name="samplePWB"    
437             Margin="5" Background="Ivory"
438             Password="password"
439           />
440         </StackPanel>
441       </Border>
443     </Grid>
444 </Window>