added samples
[windows-sources.git] / sdk / samples / WPFSamples / WPFNotepad / csharp / notepadapp.xaml
blob87979edc6d427ab76c114130eb707dbd263fc9d4
1 
4 <Application x:Uid="Application_1"
5     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
6     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
7     xmlns:cmd="clr-namespace:System.Windows.Input;assembly=PresentationCore"
8     xmlns:cmdCustom="clr-namespace:Microsoft.Samples.WPFNotepad"
9     x:Class="Microsoft.Samples.WPFNotepad.NotepadApp" xmlns:MappingPIGen1="clr-namespace:System.Windows.Input;assembly=PresentationCore" xmlns:MappingPIGen2="clr-namespace:Microsoft.Samples.WPFNotepad" xmlns:MappingPIGen3="clr-namespace:System;assembly=Mscorlib"
10     >
11     <Application.Resources>
12         <String x:Uid="String_1" xmlns="clr-namespace:System;assembly=Mscorlib" x:Key="untitled">Untitled</String>
13         <String x:Uid="String_2" xmlns="clr-namespace:System;assembly=Mscorlib" x:Key="ApplicationTitle"> - WPFNotepad</String>
14         <SolidColorBrush x:Uid="SolidColorBrush_1" x:Key="DialogBackgroundBrush" Color="{x:Static SystemColors.ControlColor}" />
15         <SolidColorBrush x:Uid="SolidColorBrush_2" x:Key="DialogFigureBrush" Color="{x:Static SystemColors.ControlDarkColor}" />
16         
17         <!-- This is the main text box that the user types in. This is a plain TextBox that 
18              is used to support the traditional baseline Notepad functionality versus RichText
19              which is implimented by a RichTextBox (see below). -->
20         <TextBox
21         x:Uid="TextBox_1"
22             x:Key="plainTextBox"
23             TabIndex="0"
24             AcceptsTab="true"
25             AcceptsReturn="true"
26             HorizontalScrollBarVisibility="Visible"
27             VerticalScrollBarVisibility="Visible"
28             SpellCheck.IsEnabled="false"
29             >
31             <!-- Context menu used for typical operations like cutting, pasting, etc. This appears
32                  when the user right-clicks on the TextBox. -->
33             <TextBox.ContextMenu>
34                 <ContextMenu
35                     x:Uid="ContextMenu_2"
36                     FlowDirection="LeftToRight"
37                     >
38                     <MenuItem x:Uid="MenuItem_1" Header="Undo" Command="Undo" />
39                     <Separator x:Uid="MenuItem_2" />
40                     <MenuItem x:Uid="MenuItem_3" Header="Cut" Command="Cut" />
41                     <MenuItem x:Uid="MenuItem_4" Header="Copy" Command="Copy" />
42                     <MenuItem x:Uid="MenuItem_5" Header="Paste" Command="Paste" />
43                     <MenuItem x:Uid="MenuItem_6" Header="Delete" Command="Delete" />
44                     <Separator x:Uid="MenuItem_7" />
45                     <MenuItem x:Uid="MenuItem_8" Header="Select All" Command="SelectAll" />
46                     <Separator x:Uid="MenuItem_9" />
47                     <MenuItem x:Uid="MenuItem_10" Header="Right to Left Reading order" Command="cmdCustom:NotepadEditor.RightToLeftReadCommand" IsCheckable="true" />
48                     <MenuItem x:Uid="MenuItem_11" Header="Show Unicode Control character" IsEnabled="false" />
49                     <MenuItem x:Uid="MenuItem_12" Header="Insert Unicode control character" IsEnabled="false" />
50                     <Separator x:Uid="MenuItem_13" />
51                     <MenuItem x:Uid="MenuItem_14" Header="Open IME" IsEnabled="false" />
52                     <MenuItem x:Uid="MenuItem_15" Header="Reconversion" IsEnabled="false" />
53                 </ContextMenu>
54             </TextBox.ContextMenu>                
55         </TextBox>
57         <!-- When the user is in "RichText Mode" this RichTextBox is the main text box the user types into. -->
58         <RichTextBox
59         x:Uid="RichTextBox_1"
60             x:Key="richTextBox"
61             TabIndex="0"
62             AcceptsTab="true"
63             AcceptsReturn="true"
64             HorizontalScrollBarVisibility="Visible"
65             VerticalScrollBarVisibility="Visible"
66             SpellCheck.IsEnabled="false"
67             >
69             <!-- Context menu used for typical operations like cutting, pasting, etc. This appears
70                  when the user right-clicks on the TextBox. -->
71             <RichTextBox.ContextMenu>    
72                 <ContextMenu x:Uid="ContextMenu_4" FlowDirection="LeftToRight">
73                         <MenuItem x:Uid="MenuItem_16" Header="Undo" Command="Undo" />
74                         <Separator x:Uid="MenuItem_17" />
75                         <MenuItem x:Uid="MenuItem_18" Header="Cut" Command="Cut" />
76                         <MenuItem x:Uid="MenuItem_19" Header="Copy" Command="Copy" />
77                         <MenuItem x:Uid="MenuItem_20" Header="Paste" Command="Paste" />
78                         <MenuItem x:Uid="MenuItem_21" Header="Delete" Command="Delete" />
79                         <Separator x:Uid="MenuItem_22" />
80                         <MenuItem x:Uid="MenuItem_23" Header="Select All" Command="SelectAll" />
81                         <Separator x:Uid="MenuItem_24" />
82                         <MenuItem x:Uid="MenuItem_25" Header="Right to Left Reading order" Command="cmdCustom:NotepadEditor.RightToLeftReadCommand" IsCheckable="true" />
83                         <MenuItem x:Uid="MenuItem_26" Header="Show Unicode Control character" IsEnabled="false" />
84                         <MenuItem x:Uid="MenuItem_27" Header="Insert Unicode control character" IsEnabled="false" />
85                         <Separator x:Uid="MenuItem_28" />
86                         <MenuItem x:Uid="MenuItem_29" Header="Open IME" IsEnabled="false" />
87                         <MenuItem x:Uid="MenuItem_30" Header="Reconversion" IsEnabled="false" />
88                  </ContextMenu>
89             </RichTextBox.ContextMenu>
90             
91         </RichTextBox>
92         
93     </Application.Resources>
95 </Application>